View Issue Details

IDProjectCategoryView StatusLast Update
0002175XdebugStep Debuggingpublic2023-07-14 09:14
Reporteralexander.willner Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformPHP 8.2.5OS* 
Product Version3.2.1 
Target Version3.2devFixed in Version3.2.2 
Summary0002175: Crash with EXC_BAD_ACCESS in xdebug_str_create
Description

Xdebug 3.2.1 crashes within PHP 8.2.5 by opening a self developed web application (based on Symfony). This happens on arm64/mac (I saw something similar on an amd64/linux machine, however, this issue report is specifically for the trace shown below).
Depending on the developer machine this happens with the Symfony debug mode on or off. In this case it has to be disabled to trigger the crash (APP_ENV=prod).

Steps To Reproduce
  1. Start the server: SSL=1 lldb -- php -d variables_order=EGPCS -S 0.0.0.0:8196 -t web web/router.php
  2. Open the page: curl http://localhost:8196
Additional Information

% SSL=1 lldb -- php -d variables_order=EGPCS -S 0.0.0.0:8196 -t web web/router.php
(lldb) target create "php"
Current executable set to 'php' (arm64).
(lldb) settings set -- target.run-args "-d" "variables_order=EGPCS" "-S" "0.0.0.0:8196" "-t" "web" "web/router.php"
(lldb) run
Process 37543 launched: '/opt/homebrew/bin/php' (arm64)
[Mon Apr 17 10:19:32 2023] PHP 8.2.5 Development Server (http://0.0.0.0:8196) started
[Mon Apr 17 10:19:35 2023] 127.0.0.1:54752 Accepted
Process 37543 stopped

  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x50)
    frame #0: 0x00000001027f7fbc xdebug.soxdebug_lib_register_compiled_variables + 76 xdebug.soxdebug_lib_register_compiled_variables:
    -> 0x1027f7fbc <+76>: ldr x8, [x8]
    0x1027f7fc0 <+80>: add x0, x8, #0x18
    0x1027f7fc4 <+84>: ldr x1, [x8, #0x10]
    0x1027f7fc8 <+88>: bl 0x10281a340 ; symbol stub for: xdebug_str_create
    Target 0: (php) stopped.
    (lldb)
Tagscrash
Operating SystemmacOS 13.3.1 (22E261)
PHP Version8.2.0-8.2.9

Relationships

related to 0002186 closedderick Segfault with trampoline functions and debugger activation 
related to 0002178 resolvedderick cant set breakpoint 

Activities

derick

2023-07-04 16:54

administrator   ~0006581

This looks the same/similar than report 0002178, but neither of them includes enough information for me to debug this. I can't manage this on Linux, with a Symfony app, but it is possible that I don't run it in the same way as you do. Is there a way for you to make a code repository that I could checkout and run myself? Please provide as much instructions as possible, as I don't really know much about setting up and running Symfony :-)

alexander.willner

2023-07-04 21:34

reporter   ~0006583

Some observations:

  • As soon as I attach the debugger to the code, I can't reproduce the crash anymore
  • This makes it difficult to create a reproducible setup for you
  • Some observations and wild guesses:
    • Could be an integer overflow. It seems that PHP crashes after the following line has been called for the 255th time: https://github.com/contao/contao/blob/05412e8efa7f7b9169279e9cfb0c711f41c7b760/core-bundle/src/Resources/contao/library/Contao/Template.php#L154C7-L154C7 - could be a coincidence though
    • Could be related to deserialization: If I replace $varValue = deserialize($varValue); with $varValue = deserialize(&quot;&quot;); or $varValue = &quot;&quot;; it crashes later in the code
    • Could be related to the output buffer: If I add a random ob_flush(); it does not crash anymore
    • Could be related to another string overflow: If I replace trigger_deprecation(&quot;&quot;, &quot;&quot;, &quot;01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678&quot;); by trigger_deprecation(&quot;&quot;, &quot;&quot;, &quot;0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567&quot;); (removed the last digit)
    • As the method trigger_deprecation only invokes trigger_error(($package || $version ? &quot;Since $package $version: &quot; : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);, it could be related to too many(?) trigger_error method calls...

This is finally the last step in my debugging process. After disabling https://github.com/symfony/contracts/blob/0b4c49b5938cd0ba7ee0df59854e191a2f44e597/Deprecation/function.php#L25 it does not crash anymore.

derick

2023-07-10 15:37

administrator   ~0006588

To make it easier to track down the bug, export export USE_ZEND_ALLOC=0 on the shell. And if you can't reproduce it then, can you try running the CLI script under valgrind? From what I know, you can run the Symfony webserver by hand in some way.

It is very likely due to trigger_error() being called in a case where something has already been destroyed. Another avenue to try is to have Xdebug also make a trace file (xdebug.mode=tracing) — this will show where in the code the crash occurs, with lots of context (like, LOTS of context).

alexander.willner

2023-07-10 17:13

reporter   ~0006589

% USE_ZEND_ALLOC=0  SSL=1 lldb -o run -- php -d variables_order=EGPCS -S 0.0.0.0:8196 -t web web/router.php
(lldb) target create &quot;php&quot;
Current executable set to 'php' (arm64).
(lldb) settings set -- target.run-args  &quot;-d&quot; &quot;variables_order=EGPCS&quot; &quot;-S&quot; &quot;0.0.0.0:8196&quot; &quot;-t&quot; &quot;web&quot; &quot;web/router.php&quot;
(lldb) run
[Mon Jul 10 19:11:38 2023] PHP 8.2.8 Development Server (http://0.0.0.0:8196) started
[Mon Jul 10 19:11:46 2023] 127.0.0.1:53493 Accepted
...
Process 21477 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x206b726f77207265)
    frame #0: 0x000000010291ffbc xdebug.so`xdebug_lib_register_compiled_variables + 76
xdebug.so`xdebug_lib_register_compiled_variables:
->  0x10291ffbc &lt;+76>: ldr    x8, [x8]
    0x10291ffc0 &lt;+80>: add    x0, x8, #0x18
    0x10291ffc4 &lt;+84>: ldr    x1, [x8, #0x10]
    0x10291ffc8 &lt;+88>: bl     0x102942340               ; symbol stub for: xdebug_str_create
Target 0: (php) stopped.
Process 21477 launched: '/opt/homebrew/bin/php' (arm64)

alexander.willner

2023-07-10 17:23

reporter   ~0006590

When enabling the debugger (also see comment above), the crash is not reproducible: USE_ZEND_ALLOC=0 SSL=1 lldb -o run -- php -d variables_order=EGPCS -dxdebug.mode=trace -dxdebug.start_with_request=yes -S 0.0.0.0:8196 -t web web/router.php (this does not crash)

derick

2023-07-13 13:01

administrator   ~0006594

I think this is now the same bug as 0002186, for which I have just made a pull request. It would be great if you could test this branch with your set-up, just to have an extra verification that this is indeed the case: https://github.com/derickr/xdebug/tree/issue2186-trampoline-get-compiled-variables

alexander.willner

2023-07-13 13:40

reporter   ~0006596

I'm afraid not. However, I've now a self-compiled xdebug version here that potentially provides more information:

warning: xdebug.so was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 82941 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x206b726f77207265)
    frame #0: 0x000000010390a194 xdebug.so`xdebug_lib_register_compiled_variables(fse=0x00000001030ad6d0, op_array=0x0000600003e23500) at lib.c:763:105 [opt]
   760  
   761      /* gather used variables from compiled vars information */
   762      while (i &lt; (unsigned int) op_array->last_var) {
-> 763          xdebug_llist_insert_next(fse->declared_vars, XDEBUG_LLIST_TAIL(fse->declared_vars), xdebug_str_create(STR_NAME_VAL(op_array->vars[i]), STR_NAME_LEN(op_array->vars[i])));
   764          i++;
   765      }
   766  }

derick

2023-07-13 17:03

administrator   ~0006597

@alexander.willner — Thanks for trying! Can you confirm what the version of Xdebug is when you run php -v?

This information does not really help much, because I don't know what the values of any of these variables are, and neither does it come with a stack trace. I don't know how lldb works (not a OSX user), but seeing all the values would be useful. In gdb, I would run bt full and p i, p op_array->last_var, p fse, p fse->declared_vars, p op_array->vars, p op_array->vars[i], and p (char*) op_array->vars[i].val. Could you do that? Alternatively, if you have the time for a screenshare debug session, that'd be awesome too.

alexander.willner

2023-07-13 17:30

reporter   ~0006598

PHP 8.2.8 (cli) (built: Jul  6 2023 10:57:44) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.8, Copyright (c), by Zend Technologies
    with Xdebug v3.3.0-dev, Copyright (c) 2002-2022, by Derick Rethans
(lldb) thread backtrace all 
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x206b726f77207265)
  * frame #0: 0x0000000103a0a194 xdebug.so`xdebug_lib_register_compiled_variables(fse=0x00000001070160d0, op_array=0x0000600003e2ef00) at lib.c:763:105 [opt]
    frame #1: 0x0000000103a1a080 xdebug.so`xdebug_debugger_error_cb [inlined] register_compiled_variables at debugger.c:121:3 [opt]
    frame 0000002: 0x0000000103a1a024 xdebug.so`xdebug_debugger_error_cb(error_filename=0x0000000118bd3cc0, error_lineno=28, type=1024, error_type_str=&quot;Notice&quot;, buffer=&quot;Since contao/core-bundle 4.0: Using \&quot;deserialize()\&quot; has been deprecated and will no longer work in Contao 5.0. Use \&quot;Contao\\StringUtil::deserialize()\&quot; instead.&quot;) at debugger.c:452:2 [opt]
    frame 0000003: 0x0000000103a04540 xdebug.so`xdebug_error_cb(orig_type=1024, error_filename=0x0000000118bd3cc0, error_lineno=28, message=0x0000600003e2ef00) at base.c:1387:3 [opt]
    frame 0000004: 0x0000000100362958 php`zend_error_zstr_at + 412
    frame 0000005: 0x0000000100362e1c php`zend_error_va_list + 68
    frame 0000006: 0x0000000100362eb0 php`zend_error + 68
    frame 0000007: 0x000000010037b910 php`zif_trigger_error + 140
    frame 0000008: 0x0000000103a04c00 xdebug.so`xdebug_execute_internal(current_execute_data=0x00000001200245c0, return_value=0x000000016fdf7ad0) at base.c:952:3 [opt]
    frame 0000009: 0x00000001003a53f8 php`ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 304
    frame 0000010: 0x0000000100382f58 php`execute_ex + 52
    frame 0000011: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120024470) at base.c:830:2 [opt]
    frame 0000012: 0x00000001003a54b4 php`ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 492
    frame 0000013: 0x0000000100382f58 php`execute_ex + 52
    frame 0000014: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120024290) at base.c:830:2 [opt]
    frame 0000015: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000016: 0x0000000100382f58 php`execute_ex + 52
    frame 0000017: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x00000001200236a0) at base.c:830:2 [opt]
    frame 0000018: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000019: 0x0000000100382f58 php`execute_ex + 52
    frame 0000020: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x00000001200234b0) at base.c:830:2 [opt]
    frame 0000021: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000022: 0x0000000100382f58 php`execute_ex + 52
    frame 0000023: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120023420) at base.c:830:2 [opt]
    frame 0000024: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000025: 0x0000000100382f58 php`execute_ex + 52
    frame 0000026: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120023110) at base.c:830:2 [opt]
    frame 0000027: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000028: 0x0000000100382f58 php`execute_ex + 52
    frame 0000029: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120022f90) at base.c:830:2 [opt]
    frame 0000030: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000031: 0x0000000100382f58 php`execute_ex + 52
    frame 0000032: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120022e00) at base.c:830:2 [opt]
    frame 0000033: 0x00000001003c76b4 php`ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER_HANDLER + 780
    frame 0000034: 0x0000000100382f58 php`execute_ex + 52
    frame #35: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120022e00) at base.c:830:2 [opt]
    frame 0000036: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000037: 0x0000000100382f58 php`execute_ex + 52
    frame 0000038: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120022790) at base.c:830:2 [opt]
    frame 0000039: 0x00000001003ab234 php`ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER + 740
    frame 0000040: 0x0000000100382f58 php`execute_ex + 52
    frame 0000041: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x00000001200221e0) at base.c:830:2 [opt]
    frame 0000042: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000043: 0x0000000100382f58 php`execute_ex + 52
    frame 0000044: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120022060) at base.c:830:2 [opt]
    frame 0000045: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000046: 0x0000000100382f58 php`execute_ex + 52
    frame 0000047: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120021ec0) at base.c:830:2 [opt]
    frame 0000048: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame #49: 0x0000000100382f58 php`execute_ex + 52
    frame 0000050: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120021120) at base.c:830:2 [opt]
    frame #51: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000052: 0x0000000100382f58 php`execute_ex + 52
    frame 0000053: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x00000001200201f0) at base.c:830:2 [opt]
    frame 0000054: 0x00000001003a54b4 php`ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 492
    frame 0000055: 0x0000000100382f58 php`execute_ex + 52
    frame 0000056: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001fbe0) at base.c:830:2 [opt]
    frame 0000057: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000058: 0x0000000100382f58 php`execute_ex + 52
    frame 0000059: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001fb40) at base.c:830:2 [opt]
    frame 0000060: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000061: 0x0000000100382f58 php`execute_ex + 52
    frame 0000062: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001fa60) at base.c:830:2 [opt]
    frame 0000063: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000064: 0x0000000100382f58 php`execute_ex + 52
    frame 0000065: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001f8f0) at base.c:830:2 [opt]
    frame 0000066: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000067: 0x0000000100382f58 php`execute_ex + 52
    frame 0000068: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001f270) at base.c:830:2 [opt]
    frame 0000069: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000070: 0x0000000100382f58 php`execute_ex + 52
    frame 0000071: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001ed40) at base.c:830:2 [opt]
    frame 0000072: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000073: 0x0000000100382f58 php`execute_ex + 52
    frame 0000074: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001dbc0) at base.c:830:2 [opt]
    frame 0000075: 0x00000001003a54b4 php`ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 492
    frame 0000076: 0x0000000100382f58 php`execute_ex + 52
    frame 0000077: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001d5b0) at base.c:830:2 [opt]
    frame 0000078: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000079: 0x0000000100382f58 php`execute_ex + 52
    frame 0000080: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001d4b0) at base.c:830:2 [opt]
    frame 0000081: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000082: 0x0000000100382f58 php`execute_ex + 52
    frame 0000083: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001cef0) at base.c:830:2 [opt]
    frame 0000084: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000085: 0x0000000100382f58 php`execute_ex + 52
    frame 0000086: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001c5a0) at base.c:830:2 [opt]
    frame 0000087: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000088: 0x0000000100382f58 php`execute_ex + 52
    frame 0000089: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001b540) at base.c:830:2 [opt]
    frame 0000090: 0x00000001003a54b4 php`ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 492
    frame 0000091: 0x0000000100382f58 php`execute_ex + 52
    frame 0000092: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001b450) at base.c:830:2 [opt]
    frame 0000093: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000094: 0x0000000100382f58 php`execute_ex + 52
    frame 0000095: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x000000012001a090) at base.c:830:2 [opt]
    frame 0000096: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000097: 0x0000000100382f58 php`execute_ex + 52
    frame 0000098: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120019be0) at base.c:830:2 [opt]
    frame 0000099: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000100: 0x0000000100382f58 php`execute_ex + 52
    frame 0000101: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120019a30) at base.c:830:2 [opt]
    frame 0000102: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000103: 0x0000000100382f58 php`execute_ex + 52
    frame 0000104: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x00000001200198a0) at base.c:830:2 [opt]
    frame 0000105: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000106: 0x0000000100382f58 php`execute_ex + 52
    frame 0000107: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120019200) at base.c:830:2 [opt]
    frame 0000108: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000109: 0x0000000100382f58 php`execute_ex + 52
    frame 0000110: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120018e30) at base.c:830:2 [opt]
    frame 0000111: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000112: 0x0000000100382f58 php`execute_ex + 52
    frame 0000113: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120018d40) at base.c:830:2 [opt]
    frame 0000114: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000115: 0x0000000100382f58 php`execute_ex + 52
    frame 0000116: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120018be0) at base.c:830:2 [opt]
    frame 0000117: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000118: 0x0000000100382f58 php`execute_ex + 52
    frame 0000119: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120018b60) at base.c:830:2 [opt]
    frame 0000120: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000121: 0x0000000100382f58 php`execute_ex + 52
    frame 0000122: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120018980) at base.c:830:2 [opt]
    frame 0000123: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000124: 0x0000000100382f58 php`execute_ex + 52
    frame 0000125: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120018610) at base.c:830:2 [opt]
    frame 0000126: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000127: 0x0000000100382f58 php`execute_ex + 52
    frame 0000128: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x00000001200184e0) at base.c:830:2 [opt]
    frame 0000129: 0x00000001003a577c php`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 432
    frame 0000130: 0x0000000100382f58 php`execute_ex + 52
    frame 0000131: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x00000001200182a0) at base.c:830:2 [opt]
    frame 0000132: 0x00000001003ab234 php`ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER + 740
    frame 0000133: 0x0000000100382f58 php`execute_ex + 52
    frame 0000134: 0x0000000103a04890 xdebug.so`xdebug_execute_ex(execute_data=0x0000000120018020) at base.c:830:2 [opt]
    frame 0000135: 0x0000000100383154 php`zend_execute + 288
    frame 0000136: 0x00000001003634d4 php`zend_execute_scripts + 156
    frame 0000137: 0x000000010044ffcc php`php_cli_server_dispatch_router + 160
    frame 0000138: 0x000000010044de2c php`php_cli_server_recv_event_read_request + 504
    frame 0000139: 0x000000010044e7dc php`php_cli_server_do_event_for_each_fd_callback + 164
    frame 0000140: 0x000000010044c8a4 php`do_cli_server + 2132
    frame 0000141: 0x0000000100447a28 php`main + 756
    frame 0000142: 0x00000001a9f8ff28 dyld`start + 2236

alexander.willner

2023-07-13 17:33

reporter   ~0006599

(lldb) p i
(unsigned int) $0 = 0
(lldb) p op_array->last_var
(int) $1 = 544432488
(lldb) p fse
(function_stack_entry *) $2 = 0x00000001070160d0
(lldb) p fse->declared_vars
(xdebug_llist *) $3 = 0x0000600000341e80
(lldb) p op_array->vars
(zend_string **) $4 = 0x206b726f77207265
(lldb) p op_array->vars[i]
error: Couldn't apply expression side effects : Couldn't dematerialize a result variable: couldn't read its memory
(lldb) p (char*) op_array->vars[i].val
  Fix-it applied, fixed expression was: 
    (char*) op_array->vars[i]->val
error: supposed to interpret, but failed: Interpreter couldn't read from memory
(lldb) 

derick

2023-07-13 17:40

administrator   ~0006600

Hi,

with Xdebug v3.3.0-dev, Copyright (c) 2002-2022, by Derick Rethans

That means you compiled GitHub's master branch, not the issue2186-trampoline-get-compiled-variables branch with the fix. Could you try again with this specific branch, as I haven't merged this yet?

cheers,
Derick

alexander.willner

2023-07-13 18:57

reporter   ~0006601

:facepalm:

I was on the wrong branch. I can confirm, that the crash does not occur anymore!

derick

2023-07-14 09:01

administrator   ~0006602

I'm glad to hear it. I'll merge it then, and make a release.

cheers,
Derick

derick

2023-07-14 09:04

administrator   ~0006604

https://github.com/xdebug/xdebug/pull/895

Issue History

Date Modified Username Field Change
2023-04-17 08:28 alexander.willner New Issue
2023-04-17 08:28 alexander.willner Tag Attached: crash
2023-07-04 16:54 derick Assigned To => derick
2023-07-04 16:54 derick Status new => feedback
2023-07-04 16:54 derick Note Added: 0006581
2023-07-04 16:55 derick Relationship added related to 0002178
2023-07-04 21:34 alexander.willner Note Added: 0006583
2023-07-04 21:34 alexander.willner Status feedback => assigned
2023-07-10 15:37 derick Status assigned => feedback
2023-07-10 15:37 derick Note Added: 0006588
2023-07-10 17:13 alexander.willner Note Added: 0006589
2023-07-10 17:13 alexander.willner Status feedback => assigned
2023-07-10 17:23 alexander.willner Note Added: 0006590
2023-07-13 13:00 derick Relationship added related to 0002186
2023-07-13 13:01 derick Status assigned => feedback
2023-07-13 13:01 derick Note Added: 0006594
2023-07-13 13:40 alexander.willner Note Added: 0006596
2023-07-13 13:40 alexander.willner Status feedback => assigned
2023-07-13 17:03 derick Status assigned => feedback
2023-07-13 17:03 derick Note Added: 0006597
2023-07-13 17:30 alexander.willner Note Added: 0006598
2023-07-13 17:30 alexander.willner Status feedback => assigned
2023-07-13 17:33 alexander.willner Note Added: 0006599
2023-07-13 17:40 derick Status assigned => feedback
2023-07-13 17:40 derick Note Added: 0006600
2023-07-13 18:57 alexander.willner Note Added: 0006601
2023-07-13 18:57 alexander.willner Status feedback => assigned
2023-07-14 09:01 derick Note Added: 0006602
2023-07-14 09:02 derick Category Uncategorized => Step Debugging
2023-07-14 09:02 derick OS macOS => *
2023-07-14 09:02 derick OS Version 13.3.1 =>
2023-07-14 09:02 derick Target Version => 3.2dev
2023-07-14 09:04 derick Status assigned => closed
2023-07-14 09:04 derick Resolution open => fixed
2023-07-14 09:04 derick Fixed in Version => 3.2dev
2023-07-14 09:04 derick Note Added: 0006604
2023-07-14 09:14 derick Fixed in Version 3.2dev => 3.2.2