View Issue Details

IDProjectCategoryView StatusLast Update
0002307XdebugUncategorizedpublic2024-12-04 15:49
Reportereveryman Assigned To 
PriorityurgentSeveritycrashReproducibilityalways
Status newResolutionopen 
Product Version3.4.0 
Summary0002307: Segmentation fault if shutdown and reference to a superglobal is generated
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
echo "bla";
$fasel = &$_GET;
register_shutdown_function(function () { echo "shutdown"; });

[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:
Zend Engine v4.3.14, Copyright (c) Zend Technologies with Zend OPcache v8.3.14, Copyright (c), by Zend Technologies with Xdebug v3.4.0, Copyright (c) 2002-2024, by Derick Rethans

Tagssegfault
Operating SystemWindows 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 Version8.3.10-8.3.19

Activities

mtassinari

2024-12-04 10:01

reporter   ~0007112

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.

Issue History

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