View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002307 | Xdebug | Uncategorized | public | 2024-12-03 12:48 | 2024-12-21 21:18 |
Reporter | everyman | Assigned To | derick | ||
Priority | urgent | Severity | crash | Reproducibility | always |
Status | confirmed | Resolution | fixed | ||
Product Version | 3.4.0 | ||||
Target Version | 3.4dev | Fixed in Version | 3.4dev | ||
Summary | 0002307: Segmentation fault due to a superglobal being a reference while checking for triggers | ||||
Description | Due to the integration of Xdebug 3.4.0 in PHP 8.3.14 (but also with PHP 8.4.1), the following PHP script causes a segmentation fault of the Apache server process when the PHP script is terminated after a reference to a superglobal was created and a shutdown function was available. | ||||
Steps To Reproduce | Due to the integration of Xdebug 3.4.0 in PHP 8.3.14 (but also in PHP 8.4.1), the following PHP script causes a segmentation fault of the Apache server process when the script is ending: <?php [Tue Dec 03 12:27:02.721336 2024] [core:notice] [pid 8081:tid 8081] AH00052: child pid 8162 exit signal Segmentation fault (11) It does not matter whether an active debugger session is running or not. It is important that both the assignment of a reference to a superglobal and the registration of a shutdown function must be present in the PHP script. Aufgefallen ist es mir zurerst in einer PHP 8.4.1 und Xdebug 3.4.0 Umgebung. Das entfernen des Xdebug-Extension hatte das Problem behoben. Genauso hat es sich mit einer PHP 8.3.14 und Xdebug 3.4.0 verhalten. Ein PHP 8.3.14 und Xdebug 3.3.2 zeigt das Problem nicht. I first noticed it in a PHP 8.4.1 and Xdebug 3.4.0 environment. Removing the Xdebug extension solved the problem. The same happened with PHP 8.3.14 and Xdebug 3.4.0. A PHP 8.3.14 and Xdebug 3.3.2 does not show the problem. | ||||
Additional Information | This program makes use of the Zend Scripting Language Engine: | ||||
Tags | segfault | ||||
Operating System | Windows 11 Docker-Desktop - Container - Debian bookworm - Linux 26d71de58aa9 6.10.14-linuxkit #1 SMP PREEMPT_DYNAMIC Thu Oct 24 19:30:56 UTC 2024 x86_64 GNU/Linux | ||||
PHP Version | 8.3.10-8.3.19 | ||||
|
I think the bug I reported (https://bugs.xdebug.org/view.php?id=2306) might be related with this; in fact, in our webapp, we do get references to the superglobals at the very beginning of the request cycle. However, in my case, there is not shutdown function registered, and the segfault happens only when the debugging session is not actually started. |
|
I can trivially reproduce this. Thanks for the short and succint report! |
|
This turned out to be a similar issue than 0002305 — at least it has the same cause. I have made a PR: https://github.com/xdebug/xdebug/pull/986 Would you be able to check the xdebug_3_4 branch from Xdebug's Github (once it's merged)? |
|
I also ran into this issue, using xdebug 3.4.0 on 8.3 and 8.4. Using xdebug latest master branch solved this issue. Thank you Derick, happy holidays. |
|
Although this changes solves most issues, I have to add that this is not the only cause of segmentation faults in 3.4.0. This snippet of code still causes a segfault: <?php set_exception_handler(static function () { require_once '_non_existing_file'; |
|
I have checked out the xdebug_3_4 branch and added the compiled xdebug of a PHP 8.4. The problem can no longer be reproduced with this version.This program makes use of the Zend Scripting Language Engine: |
|
I can confirm https://bugs.xdebug.org/view.php?id=2307#c7124 with a similar variant: --- test2.php --- test1.php Calling test1.php with a PHP 8.4 and Xdebug v3.4.1-dev also returns a segmentation fault. |
|
It seemed that I fixed a symptom, and not the actual issue, which is: Segmentation fault due to a superglobal being a reference |
|
|
|
I've merged the PR. It would be great if you could have a check/look again! |
|
All seems fine with the last revision. Thank you Derick. |
Date Modified | Username | Field | Change |
---|---|---|---|
2024-12-03 12:48 | everyman | New Issue | |
2024-12-04 10:01 | mtassinari | Note Added: 0007112 | |
2024-12-04 15:49 | mtassinari | Tag Attached: segfault | |
2024-12-13 17:21 | derick | Assigned To | => derick |
2024-12-13 17:21 | derick | Status | new => confirmed |
2024-12-13 17:21 | derick | Note Added: 0007115 | |
2024-12-13 17:22 | derick | Target Version | => 3.4dev |
2024-12-13 17:39 | derick | Summary | Segmentation fault if shutdown and reference to a superglobal is generated => Segmentation fault during shutdown and checking for triggers |
2024-12-13 17:39 | derick | Note Added: 0007116 | |
2024-12-13 17:40 | derick | Relationship added | has duplicate 0002306 |
2024-12-13 17:57 | derick | Status | confirmed => closed |
2024-12-13 17:57 | derick | Resolution | open => fixed |
2024-12-13 17:57 | derick | Fixed in Version | => 3.4dev |
2024-12-17 15:33 | langemeijer | Note Added: 0007123 | |
2024-12-17 16:35 | langemeijer | Note Added: 0007124 | |
2024-12-17 18:23 | everyman | Note Added: 0007125 | |
2024-12-17 18:28 | everyman | Note Added: 0007126 | |
2024-12-20 16:23 | derick | Status | closed => confirmed |
2024-12-20 16:23 | derick | Note Added: 0007128 | |
2024-12-20 16:24 | derick | Summary | Segmentation fault during shutdown and checking for triggers => Segmentation fault due to a superglobal being a reference while checking for triggers |
2024-12-20 16:24 | derick | Note Added: 0007129 | |
2024-12-20 16:25 | derick | Relationship added | has duplicate 0002310 |
2024-12-20 16:37 | derick | Note Added: 0007131 | |
2024-12-21 21:18 | langemeijer | Note Added: 0007132 |