View Issue Details

IDProjectCategoryView StatusLast Update
0002331XdebugStep Debuggingpublic2025-05-14 09:36
Reporterhburger Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version3.4.2 
Target Version3.4devFixed in Version3.4.3 
Summary0002331: Segmentation fault with 'invalid' variable names
Description

A segmentation fault happens when assigning any value to $GLOBALS using an index that ends with "-h" while step-debugging.
Example:
$GLOBALS["x"] = 1; -> works,
$GLOBALS["x-h"] = 1; -> Segfault

Without an active breakpoint the script will run fine. I could reproduce it through Apache as well as CLI

Steps To Reproduce

Using the attached example (test.php):

  1. Set a breakpoint on the echo-statement in line 3.
  2. Run the Script
Additional Information

PHP-Version:

PHP 8.4.5 (cli) (built: Mar 13 2025 17:27:36) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.5, Copyright (c) Zend Technologies
with Zend OPcache v8.4.5, Copyright (c), by Zend Technologies
with Xdebug v3.4.2, Copyright (c) 2002-2025, by Derick Rethans

I ran the code inside a Docker Container using "debian:bookworm-slim" as the image and installed php/xdebug from sury

TagsNo tags attached.
Operating System
PHP Version8.4-dev

Activities

derick

2025-03-26 11:31

administrator   ~0007220

This turns out to not be a problem with $GLOBALS per-se, but rather that the variable parser would see this as the syntax $x-h which isn't valid. Of course, you can set this in $GLOBALS by using the array syntax.

I have fixed the crash with https://github.com/xdebug/xdebug/pull/1003, but Xdebug still won't be able to show you the value for it.