View Issue Details

IDProjectCategoryView StatusLast Update
0001312XdebugStep Debuggingpublic2020-03-12 16:43
Reporteraschwinw Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platform*OS*OS Version*
Product Version2.4.0 
Target Version2.6.0Fixed in Version2.6.0alpha1 
Summary0001312: Implement DBGP's extended_properties to support names and values with \0
Description

If I use this snippet in my code:

    $iterator = new RecursiveArrayIterator($entity);
    $clone = $iterator->getArrayCopy();

Where $entity is any instantiated object I throw in.

XDebug will not step further beyond the $clone declaration. I'm using PHPStorm as IDE.

I thought the SPL objects didn't cause a problem anymore since the fixed 0000686 issue? Anything I missed?

I can reproduce this over and over again.

Steps To Reproduce

// This can be any object, while stdClass() or an array are fine
$entity = new Object();
$iterator = new RecursiveArrayIterator($entity);
$clone = $iterator->getArrayCopy();

Any breakpoint beyond the $clone declaration will not be reached.

Tagsgetarraycopy, iterator, recursive array iterator, SPL, standard php library
Attached Files
xdebug.log (41,802 bytes)
spl_xdebug_fail.php (241 bytes)   
<?php

class A
{
    private $test;
    
    public function __construct()
    {
        $this->test = 'testable';
    }
}

$object = new A();
$iterator = new RecursiveArrayIterator($object);
$clone = $iterator->getArrayCopy();

$test = '';
spl_xdebug_fail.php (241 bytes)   
Operating System
PHP Version7.0.5-7.0.9

Relationships

has duplicate 0000924 resolvedderick $test = array("\0" => ''); renders variable view inoperable 

Activities

derick

2016-06-10 10:16

administrator   ~0003632

Can you provide all the information as is described at: https://xdebug.org/support.php#remote ?

aschwinw

2016-06-10 12:46

reporter   ~0003633

I've uploaded the requested files.

If I set the breakpoint at $test (last instruction) XDebug will not reach it.

derick

2016-12-18 21:43

administrator   ~0004081

This seems to be not a bug in Xdebug, but something that is not implemented. Because the property name has a null character in it, Xdebug can not send it over the protocol, but it does. PhpStorm's XML parser can't handle � and errors out, and closes the connection with:

<code>
[4162117] WARN - php.debug.xdebug.dbgp.DbgpUtil - Could not parse packet
org.jdom.input.JDOMParseException: Error on line 2: Character reference "&#0" is an invalid XML character.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:533)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:315)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:309)
at com.jetbrains.php.debug.xdebug.dbgp.DbgpUtil.parseDocument(DbgpUtil.java:163)
at com.jetbrains.php.debug.xdebug.dbgp.DbgpUtil.getDocument(DbgpUtil.java:135)
at com.jetbrains.php.debug.xdebug.dbgp.DbgpUtil.readDocument(DbgpUtil.java:111)
at com.jetbrains.php.debug.xdebug.dbgp.DbgpUtil.readMessage(DbgpUtil.java:248)
at com.jetbrains.php.debug.xdebug.connection.XdebugConnection$MyInputReader.read(XdebugConnection.java:88)
at com.jetbrains.php.debug.xdebug.connection.XdebugConnection$MyInputReader.read(XdebugConnection.java:77)
at com.jetbrains.php.debug.connection.PhpDebugConnection$4.run(PhpDebugConnection.java:298)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
</code>

The DBGp protocol that Xdebug uses, does support a different approach to this, through "extended_properties" as is described at https://xdebug.org/docs-dbgp.php#properties-variables-and-values

Xdebug (and I presume, PhpStorm), don't support this yet. So I am marking this for Xdebug 2.6dev as a new feature.

aschwinw

2016-12-19 07:21

reporter   ~0004082

Ok, that's clear Derick.

Thanks for looking into this. I'm glad you've found the cause of this and a possible solution.

I'm looking forward to see if you managed to solve this as a new feature. Have yourself a great holiday season.

derick

2016-12-19 12:16

administrator   ~0004087

I have added a bug report for PhpStorm at https://youtrack.jetbrains.com/issue/WI-34403 - but already working on this on the Xdebug side.

derick

2016-12-20 16:59

administrator   ~0004093

I've implemented this on my side in Git, now it's up to PhpStorm to make use of this.

aschwinw

2016-12-21 07:53

reporter   ~0004094

Again, thanks Derick for picking it up so quickly after you discovered the cause of this.

I hope JetBrains will take it as serious as you do. ;-)

Issue History

Date Modified Username Field Change
2016-06-10 09:15 aschwinw New Issue
2016-06-10 10:16 derick Note Added: 0003632
2016-06-10 10:16 derick Assigned To => derick
2016-06-10 10:16 derick Status new => feedback
2016-06-10 12:45 aschwinw File Added: xdebug.log
2016-06-10 12:45 aschwinw File Added: spl_xdebug_fail.php
2016-06-10 12:46 aschwinw Note Added: 0003633
2016-06-10 12:46 aschwinw Status feedback => assigned
2016-06-24 20:50 aschwinw Tag Attached: getarraycopy
2016-06-24 20:50 aschwinw Tag Attached: iterator
2016-06-24 20:50 aschwinw Tag Attached: recursive array iterator
2016-06-24 20:50 aschwinw Tag Attached: SPL
2016-06-24 20:50 aschwinw Tag Attached: standard php library
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2016-12-04 16:05 derick Status assigned => acknowledged
2016-12-17 17:14 derick Severity crash => minor
2016-12-17 17:14 derick Summary Possible duplicate of 686 but still present => Problem with inspecting SPL objects
2016-12-18 01:24 derick Status acknowledged => assigned
2016-12-18 21:43 derick Note Added: 0004081
2016-12-18 21:43 derick Category Usage problems (Wrong Results) => Feature/Change request
2016-12-18 21:43 derick OS OSX => *
2016-12-18 21:43 derick OS Version El Capitan => *
2016-12-18 21:43 derick Platform Mac => *
2016-12-18 21:43 derick Target Version => 2.6.0dev
2016-12-19 07:21 aschwinw Note Added: 0004082
2016-12-19 12:16 derick Note Added: 0004087
2016-12-20 16:59 derick Note Added: 0004093
2016-12-20 16:59 derick Status assigned => closed
2016-12-20 16:59 derick Fixed in Version => 2.6.0dev
2016-12-20 16:59 derick Summary Problem with inspecting SPL objects => Implement DBGP's extended_properties to support names and values with \0
2016-12-21 07:53 aschwinw Note Added: 0004094
2017-01-10 14:27 derick Relationship added has duplicate 0000924
2017-01-10 23:40 derick Resolution open => fixed
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:43 derick Category Feature/Change request => Step Debugging