View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001682 | Xdebug | Step Debugging | public | 2019-07-11 08:08 | 2019-07-25 14:19 |
Reporter | arnaud-lb | Assigned To | derick | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.7.2 | ||||
Target Version | 2.8.0dev | Fixed in Version | 2.8.0beta1 | ||
Summary | 0001682: Invalid character reference (null byte) in debugger XML | ||||
Description | When debugging, the XML might contain encoded null bytes (). These appear to not be allowed in XML, and they cause a parse error in libxml. Example: classname="class@anonymous/tmp/phpstan-tests/cache/nette.configurator/Container_6005a4979b.php0x7fbf3b58444b" In vim/vdebug, this results in the following error: An error occured: <class 'xml.etree.ElementTree.ParseError'> | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Operating System | |||||
PHP Version | 7.3.5-7.3.9 | ||||
|
Mantis apparently converted my xml-encoded null bytes to actual null bytes. Please read � instead of |
|
Can you please add the additional information as is requested at https://xdebug.org/support.php#remote ? |
|
Sure! Here is a reproducing script, and the xdebug.log. You can see the encoded null byte at line 25, after the <code>context_get -i 7 -c 0 -d 0</code> command. xdebug.log (3,280 bytes)
[28489] Log opened at 2019-07-11 18:09:24 [28489] I: Connecting to configured address/port: 127.0.0.1:9000. [28489] I: Connected to client. :-) [28489] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///home/mention/xdebug1682/bug.php" language="PHP" xdebug:language_version="7.1.24" protocol_version="1.0" appid="28489" idekey="xdebug"><engine version="2.7.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init> [28489] [28489] <- context_names -i 1 [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="1"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response> [28489] [28489] <- step_into -i 2 [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="2" status="break" reason="ok"><xdebug:message filename="file:///home/mention/xdebug1682/bug.php" lineno="3"></xdebug:message></response> [28489] [28489] <- stack_get -i 3 [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="3"><stack where="{main}" level="0" type="file" filename="file:///home/mention/xdebug1682/bug.php" lineno="3"></stack></response> [28489] [28489] <- context_get -i 4 -c 0 -d 0 [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="4" context="0"><property name="$a" fullname="$a" type="uninitialized"></property></response> [28489] [28489] <- step_over -i 5 [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="5" status="break" reason="ok"><xdebug:message filename="file:///home/mention/xdebug1682/bug.php" lineno="5"></xdebug:message></response> [28489] [28489] <- stack_get -i 6 [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="6"><stack where="{main}" level="0" type="file" filename="file:///home/mention/xdebug1682/bug.php" lineno="5"></stack></response> [28489] [28489] <- context_get -i 7 -c 0 -d 0 [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="7" context="0"><property name="$a" fullname="$a" type="object" classname="class@anonymous�/home/mention/xdebug1682/bug.php0x7f45a3d6d018" children="0" numchildren="0" page="0" pagesize="32"></property></response> [28489] [28489] <- stop -i 8 [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="8" status="stopped" reason="ok"></response> [28489] [28489] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="8" status="stopping" reason="ok"></response> [28489] [28489] Log closed at 2019-07-11 18:09:41 [28489] |
|
Fixed in GitHub for 2.8.0alpha2 |
|
Thanks ! |
|
Please note that your IDE still needs to set that extended_properties feature for this to work. |
|
Hi, (seem that I wrote this note, but never posted it) I did have a look, and although there is a bug here, it is not the one you've brought up. The DBGp protocol has a specific feature to turn on "extended_properties" (https://xdebug.org/docs-dbgp.php#extended-properties) that IDEs need to opt into to work around the problem if having invalid XML characters in attribute values. This is an opt-in feature, as otherwise IDEs that don't enable it might get data back they originally did not expect. The bug here is that when either of the "name, fullname, classname or value" elements needs to be encoded, all need to be encoded. And Xdebug does not do that at the moment: it will only do the "classname" as extended property if invalid XML characters are found, but not name or fullname. The latter is now fixed for Xdebug 2.8.0alpha2. cheers, |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-07-11 08:08 | arnaud-lb | New Issue | |
2019-07-11 08:10 | arnaud-lb | Note Added: 0005053 | |
2019-07-11 08:42 | derick | Assigned To | => derick |
2019-07-11 08:42 | derick | Status | new => feedback |
2019-07-11 08:42 | derick | Note Added: 0005054 | |
2019-07-11 18:18 | arnaud-lb | File Added: bug.php | |
2019-07-11 18:18 | arnaud-lb | File Added: xdebug.log | |
2019-07-11 18:18 | arnaud-lb | Note Added: 0005055 | |
2019-07-11 18:18 | arnaud-lb | Status | feedback => assigned |
2019-07-11 19:32 | derick | Status | assigned => confirmed |
2019-07-11 19:32 | derick | Target Version | => 2.8.0dev |
2019-07-15 14:48 | derick | Status | confirmed => closed |
2019-07-15 14:48 | derick | Resolution | open => fixed |
2019-07-15 14:48 | derick | Fixed in Version | => 2.8.0dev |
2019-07-15 14:48 | derick | Note Added: 0005059 | |
2019-07-17 11:25 | arnaud-lb | Note Added: 0005065 | |
2019-07-17 11:44 | derick | Note Added: 0005066 | |
2019-07-19 13:34 | derick | Note Added: 0005076 | |
2019-07-25 14:19 | derick | Fixed in Version | 2.8.0dev => 2.8.0beta1 |
2020-03-12 16:33 | derick | Category | Remote Debugging => Step Debugging |