View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002383 | Xdebug | Uncategorized | public | 2025-11-10 10:43 | 2026-01-14 11:04 |
| Reporter | SunMar | Assigned To | |||
| Priority | low | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | unable to reproduce | ||
| Platform | x86_64 | OS | Debian | OS Version | Trixie |
| Product Version | 3.4.6 | ||||
| Summary | 0002383: Segmentation fault (8.3) / zend_mm_heap corrupted (8.4) | ||||
| Description | Currently using XDebug 3.4.7 but this was not a selectable production version. When running our test suite when using PHP 8.3.20+ or PHP 8.4.6+ with XDebug enabled, in the middle of the PHPUnit test suite it crashes with either Segmentation fault (PHP 8.3) or zend_mm_heap corrupted (PHP 8.4). If I set the environment variable XDEBUG_MODE="off" the issue disappears. The crash happens both in my local where XDebug is running with mode "develop,debug" and in our pipeline where it's running with "coverage". | ||||
| Steps To Reproduce | Although I can consistently reproduce the issue when I run the whole (large) PHPUnit test suite, running the individual tests where it crashes works. I have reproduced it using a debug build with "--enable-debug --enable-address-sanitizer --enable-undefined-sanitizer" and environment variables ASAN_OPTIONS="halt_on_error=0" and USE_ZEND_ALLOC=0. If there is more information I can provide let me know and I'll happily spend some time collecting more details. | ||||
| Additional Information | See attached log files with the output of both PHP 8.3 and PHP 8.4 after running the suite with the PHP debug build. | ||||
| Tags | No tags attached. | ||||
| Operating System | |||||
| PHP Version | 8.4.10-8.4.19 | ||||
|
|
Just noticed I didn't specify the PHP versions. Testing was done on PHP 8.3.27 and PHP 8.4.14, but I went back through older versions and PHP 8.3.19 and PHP 8.4.5 were fine, crashing started happening from 8.3.20/8.4.6 onwards. |
|
|
I just had a look at the traces, and these both indicate that the undefined read happens when PHP's GC is cleaning things up. However, it doesn't tell me which thing, only that it was allocated in SimpleXMLElement_getNamespaces, and being freed through a foreach loop ending (in the PHP 8.4 case). But I can't see what, or how, which makes it impossible for me to find this. From this trace, I am not even sure if it's solely an Xdebug issue or whether SimpleXML is broken. Could I attempt to debug it with your whole suite locally? |
|
|
Thanks for the reply! Unfortunately I can't share the whole suite. The problem is that this is a integration/functional test on some legacy code with a bunch of inter-dependencies, so it doesn't work unless you have the whole application running. |
|
|
I would recommend running everything through valgrind, with the environment variable |
|
|
I am running everything in a Docker container and added ''ENV USE_ZEND_ALLOC=0'' in the ''Dockerfile'', but I will double check to make sure it's set when I start debugging again and will take a look if I can get valgrind working. Thanks for the pointers! |
|
|
Hi, sorry that it took a bit, things got busy, but today I had some time to dive into this again. This ticket can be closed, if it comes back I'll investigate more and re-open or create a new ticket. |
|
|
Ok, thanks for letting us know. And if this indeed returns, feel free to file a new ticket. |