View Issue Details

IDProjectCategoryView StatusLast Update
0002297XdebugUncategorizedpublic2025-11-25 14:22
Reporterschlndh Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status confirmedResolutionopen 
Product Version3.3.2 
Target Version3.6dev 
Summary0002297: Crash in exception handler
Description

I'm working on a web application which uses Tracy to catch and report errors. However, when I run into an exception with Xdebug enabled then PHP often crashes (SIGSEGV) inside of Tracy. I was able to reduce the issue down from thousands of lines of code to 3 small files by gradually inlining and removing code. At this point it seems that I can't remove any more code.

Steps To Reproduce

Download the attached php and phtml files. Run index.php like this: php -n -d zend_extension=xdebug.so -d xdebug.mode=develop,debug index.php

Additional Information

php -v:

PHP 8.3.12 (cli) (built: Sep 29 2024 09:30:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.12, Copyright (c) Zend Technologies
with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans

The crash does NOT happen when Xdebug is not loaded. The crash also does NOT happen with USE_ZEND_ALLOC=0 ZEND_DONT_UNLOAD_MODULES=1.

Tagssegfault
Operating SystemArchLinux (kernel 6.11.2)
PHP Version8.3.10-8.3.19

Activities

derick

2024-10-13 14:28

administrator   ~0007072

I can indeed replicate this with your excellent reproducible case. Thanks! I'll have a look to see as to how to fix this.

derick

2024-10-13 16:02

administrator   ~0007073

I can now reproduce this with a much smaller case:

<?php
set_exception_handler(function (\Throwable $exception) {
    $code = '#' . $exception->getCode();
    eval('$code = 43; strlen();');
});

throw new RuntimeException('');

Run with: USE_ZEND_ALLOC=0 valgrind php -n -d zend_extension=xdebug.so -d xdebug.mode=develop,debug index.php