View Issue Details

IDProjectCategoryView StatusLast Update
0000289XdebugUncategorizedpublic2007-07-08 21:04
ReporterAlexD Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionopen 
Summary0000289: Xdebug terminates connection when eval fails
Description

xdebug sends back status='stopped' with error code 'ok' and closes connection and terminates the debug session when it gets something like 'asdasd.asdasd(asdasd)' (this is completely wrong sentence) to evaluate. It should not happen - closing of the connection. Xdebug should return smth like 'not initialized' or 'invalid'

TagsNo tags attached.
Operating System
PHP Version5.2.1

Activities

AlexD

2007-07-02 08:49

reporter   ~0000671

Platform: WinXP, XDebug 2.0.0rc4 is taken here as a compiled version.

derick

2007-07-03 22:31

administrator   ~0000673

Could you please provide some complete, but short, sample code and a remote debugger log? Please see "Remote Debugger Bugs" at http://xdebug.org/support.php

derick

2007-07-07 22:00

administrator   ~0000678

Reminder sent to AlexD

Could you please provide some complete, but short, sample code and a remote debugger log? Please see "Remote Debugger Bugs" at http://xdebug.org/support.php

AlexD

2007-07-08 13:25

reporter   ~0000681

sorry for delay...

This is the log:
Log opened at 2007-07-08 12:10:44
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug&quot; fileuri="file:///C%3A%5Ctest.php" language="PHP" protocol_version="1.0" appid="7096" idekey="Alex"><engine version="2.0.0RC4"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]>&lt;/url>&lt;copyright>&lt;![CDATA[Copyright (c) 2002-2007 by Derick Rethans]]></copyright></init>

<- eval -i 1 -- asd.asd(asd)
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug&quot; command="eval" transaction_id="1"><property address="12710568" type="string" size="6" encoding="base64"><![CDATA[asdasdas]]></property></response>

This is PHP file (sensless):

<?php

$xx = array( 0=> array('id'=>1, 'name'=>'name1'), 1=> array('id'=>2, 'name'=>'name2'));

$s = in_array(array('id'=>1), $xx);

echo 'asd';
echo $s;

?>

When it runs under visual studion 2003, I've got an exception with following stack trace:

ntdll.dll!7c901230()
ntdll.dll!7c96c943()
ntdll.dll!7c96cd80()
ntdll.dll!7c960af8()
kernel32.dll!7c85ebcf()
php_xdebug.dll!_CrtIsValidHeapPointer(const void pUserData=0x0132ffe0) Line 1807 C
php_xdebug.dll!_free_dbg_lk(void
pUserData=0x0132ffe0, int nBlockUse=1) Line 1132 + 0x9 C
php_xdebug.dll!_free_dbg(void pUserData=0x0132ffe0, int nBlockUse=1) Line 1070 + 0xd C
php_xdebug.dll!xdebug_xml_text_node_dtor(_xdebug_xml_text_node
node=0x013e2db8) Line 142 + 0xd C
php_xdebug.dll!xdebug_xml_node_dtor(_xdebug_xml_node xml=0x013e2c78) Line 193 + 0xc C
php_xdebug.dll!xdebug_xml_node_dtor(_xdebug_xml_node
xml=0x013e2878) Line 184 + 0xc C
php_xdebug.dll!xdebug_dbgp_cmdloop(_xdebug_con context=0x012d85bc, void tsrm_ls=0x003c2dd8) Line 2208 + 0x9 C
php_xdebug.dll!xdebug_dbgp_init(_xdebug_con context=0x012d85bc, int mode=2) Line 2332 + 0xd C
php_xdebug.dll!xdebug_execute(_zend_op_array
op_array=0x0117f3c8, void tsrm_ls=0x003c2dd8) Line 1395 + 0x34 C
php5ts_debug.dll!zend_execute_scripts(int type=8, void
tsrm_ls=0x003c2dd8, _zval_struct retval=0x00000000, int file_count=3, ...) Line 1134 + 0x21 C
php5ts_debug.dll!php_execute_script(_zend_file_handle primary_file=0x00c1ff28, void tsrm_ls=0x003c2dd8) Line 1794 + 0x1b C
php.exe!main(int argc=7, char argv=0x003c2c88) Line 1130 + 0x13 C
php.exe!mainCRTStartup() Line 398 + 0x11 C
kernel32.dll!7c816ff7()

It looks like the data corruption is happend somewhere, because in func xdebug_xml_text_node_dtor on line 142 node->text had a trash... But I'm not sure about that... not a C-man :)

There is one more problem: xdebug.remote_log doesn't work in WinXP. I had to comment out in usefulstuff.c, in function FILE xdebug_fopen(char fname, char mode, char extension, char **new_fname) the following block:

if (new_fname) {
    *new_fname = tmp_fname;
} else {
    xdfree(tmp_fname);
} 

Because new_fname is null in case of the log file, tmp_fname will be freed before opening of the temp file. Now it's a mem leak too, but at least I had a chance to get the log.

AlexD

2007-07-08 13:26

reporter   ~0000682

forgot.

After giving of "eval -i 1 -- asd.asd(asd)" I'm getting immediately "Disconnect" in debugclient (your one)...

AlexD

2007-07-08 13:58

reporter   ~0000685

this is the complete remote log (the previous one has been cutted because of debugging session)

Log opened at 2007-07-08 12:56:43
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug&quot; fileuri="file:///F%3A%5Chome%5CAlex%5Cwork%5Cprojects%5Ctest.php" language="PHP" protocol_version="1.0" appid="5936" idekey="Alex"><engine version="2.0.0RC4"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]>&lt;/url>&lt;copyright>&lt;![CDATA[Copyright (c) 2002-2007 by Derick Rethans]]></copyright></init>

<- eval -i 1 -- asd.asd(asd)
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug&quot; command="eval" transaction_id="1"><property address="12647228" type="string" size="6" encoding="base64"><![CDATA[asdasdas]]></property></response>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug&quot; status="stopped" reason="ok"></response>

Log closed at 2007-07-08 12:56:49

derick

2007-07-08 21:04

administrator   ~0000686

I fixed both issues in CVS, thanks for the report.

Issue History

Date Modified Username Field Change
2007-07-02 08:48 AlexD New Issue
2007-07-02 08:49 AlexD Note Added: 0000671
2007-07-03 22:31 derick Note Added: 0000673
2007-07-03 22:31 derick Status new => feedback
2007-07-07 22:00 derick Note Added: 0000678
2007-07-08 13:25 AlexD Note Added: 0000681
2007-07-08 13:26 AlexD Note Added: 0000682
2007-07-08 13:58 AlexD Note Added: 0000685
2007-07-08 21:04 derick Status feedback => closed
2007-07-08 21:04 derick Note Added: 0000686
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)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized