View Issue Details

IDProjectCategoryView StatusLast Update
0001449XdebugStep Debuggingpublic2017-12-02 18:36
Reportermlocati Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformWindows 10 
Product Version2.5.5 
Target Version2.6.0Fixed in Version2.6.0alpha1 
Summary0001449: Debugging breaks with array element keys containing low-ASCII variable
Description

When inspecting a variable that contains an instance of a class that extends \ArrayObject (and only in this case), my IDE hungs and the execution crashes if the instance contains some values.

Steps To Reproduce
  • Create a composer project that requires "gettext/gettext" : "0000003:0000003.6.1"

  • Create this PHP file
    <?php
    use Gettext\Translations;
    require_once 'path/to/vendor/autoload.php';
    $translations = new Translations();
    $translations->insert('context', 'string');
    var_dump($translations);

  • Place a breakpoint at the "var_dump" line

  • When the breakpoint is hit, try to evaluate the "$translations" variable

Additional Information

IDE: Eclipse Oxygen (4.7) with PDT 5.1.0.201706291405 (but I had this issue with older Eclipse and PDT versions)

php.ini settings for xdebug:
[XDebug]
zend_extension="C:\Dev\PHP7.0\ext\php_xdebug-2.5.5-7.0-vc14.dll"
xdebug.max_nesting_level=250
xdebug.remote_enable=1
xdebug.var_display_max_depth=10
xdebug.profiler_append=0
xdebug.profiler_output_dir=C:\Dev\Temp\php_profiler
xdebug.profiler_output_name=callgrind.%u
xdebug.remote_log=C:\Dev\Temp\xdebug-remote.log

Output of php.exe -v
PHP 7.0.20 (cli) (built: Jun 6 2017 14:32:47) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

See attachment for the log of "xdebug.remote_log"

TagsNo tags attached.
Attached Files
xdebug-remote.log (29,223 bytes)
Operating System
PHP Version7.0.20-7.0.24

Activities

mlocati

2017-06-30 08:22

reporter   ~0004360

Last edited: 2017-06-30 08:22

I don't know why the "Steps To Reproduce" reports
"gettext/gettext" : "0000003:0000003.6.1"

the version is tilde followed by 3.6.1

mlocati

2017-06-30 08:40

reporter   ~0004361

I'm able to reproduce this bug even with this very simple code:

<?php
$var = new ArrayObject([]);
$var->offsetSet("1\x042", 'x');
var_dump($var);

The crash occurs if the index contains chars < 0x20 (like 0x04 in the above example)

mlocati

2017-06-30 16:36

reporter   ~0004362

PS: I don't know if it's an xdebug or an Eclipse+PDT bug, so I also filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=519045

derick

2017-07-16 09:59

administrator   ~0004371

There are two issues at play here.

The first one is that from your log I see that Xdebug doesn't escape the \x04 properly in its XML output, and this is likely why PDT falls over.

The second issue is that I don't even get there due to a "can not read property" bug that has been cropping up. I do have an idea how to fix that, but it's harder than I thought.

I'll amend this ticket to only track the unescaped \x04 though.

derick

2017-11-05 23:22

administrator   ~0004453

This is now fixed for Xdebug 2.6.0-dev, but, it requires that the IDE sets the "extended_properties" feature (https://xdebug.org/docs-dbgp.php#feature-names). This new feature is supported in 2.6.0dev, through https://bugs.xdebug.org/view.php?id=1312.

Issue History

Date Modified Username Field Change
2017-06-30 08:19 mlocati New Issue
2017-06-30 08:19 mlocati File Added: xdebug-remote.log
2017-06-30 08:22 mlocati Note Added: 0004360
2017-06-30 08:22 mlocati Note Edited: 0004360
2017-06-30 08:40 mlocati Note Added: 0004361
2017-06-30 16:36 mlocati Note Added: 0004362
2017-07-16 09:59 derick Note Added: 0004371
2017-07-16 10:00 derick Severity crash => major
2017-07-16 10:00 derick Status new => confirmed
2017-07-16 10:00 derick Target Version => 2.5.6
2017-07-16 10:00 derick Summary Crash when inspecting an class instance that extends \ArrayObject => Properties in \ArrayObject's storage are not correctly escaped
2017-11-05 14:08 derick Target Version 2.5.6 => 2.6.0dev
2017-11-05 14:08 derick Summary Properties in \ArrayObject's storage are not correctly escaped => Debugging breaks with array element keys containing low-ASCII variable
2017-11-05 23:22 derick Note Added: 0004453
2017-11-05 23:22 derick Status confirmed => closed
2017-11-05 23:22 derick Assigned To => derick
2017-11-05 23:22 derick Resolution open => fixed
2017-11-05 23:22 derick Fixed in Version => 2.6.0dev
2017-12-02 15:57 derick Fixed in Version 2.6.0dev => 2.6.0alpha1
2017-12-02 18:34 derick Target Version 2.6.0dev => 2.6.0alpha1
2017-12-02 18:36 derick Target Version 2.6.0alpha1 => 2.6.0
2020-03-12 16:33 derick Category Remote Debugging => Step Debugging