[xdebug-dev] Bug 0000270: Debugger aborts when PHP's eval() is encountered.

From: <noreply[@]lists.xdebug.org>
Date: Fri, 1 Jun 2007 14:24:07 +0200

The following bug has been CLOSED
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000270
======================================================================
Reporter: albert66
Handler: derick
======================================================================
Project: Xdebug
Bug ID: 270
Category: Usage problems
Reproducibility: always
Severity: crash
Priority: normal
Status: closed
Operating System: Linux (Fedora Core 4)
PHP Version: 5.0.4
Xdebug Version: 2.0.0rc4
======================================================================
Date Submitted: 2007-05-21 10:15 CEST
Last Modified: 2007-06-01 14:24 CEST
======================================================================
Summary: Debugger aborts when PHP's eval() is encountered.
Description:
The debugger exits when a script calls PHP's eval().

Example:

<?php
print "hello";
eval("print 'to';");
print "you";
?>

When execution point passes at the second line, the debugger aborts.
======================================================================

----------------------------------------------------------------------
 albert66 - 2007-05-21 15:16 CEST
----------------------------------------------------------------------
BTW, for the "severity" field of this report I've chosen "crash". I now
believe "crash" means: a crash of the http server or of PHP. No, that's
not what happens. Sorry for misleading you. It doesn't crash. The debugger
aborts but I can restart another debugging session without a problem. It's
just that the debugging session terminates on an eval() call.

----------------------------------------------------------------------
 derick - 2007-05-22 22:59 CEST
----------------------------------------------------------------------
I can not reproduce this with the bundled client:

Waiting for debug server to connect.
Connect

<?xml version="1.0" encoding="iso-8859-1"?>

<init xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
fileuri="file:///home/httpd/html/test/xdebug/bug270.php" language="PHP"
protocol_version="1.0" appid="16229" idekey="dr"><engine
version="2.0.0RC4"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick
Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright
(c) 2002-2007 by Derick Rethans]]></copyright></init>

(cmd) step_into -i 1

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="1" status="break" reason="ok"><xdebug:message
filename="/home/httpd/html/test/xdebug/bug270.php"
lineno="2"></xdebug:message></response>

(cmd) step_into -i 1

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="1" status="break" reason="ok"><xdebug:message
filename="/home/httpd/html/test/xdebug/bug270.php"
lineno="3"></xdebug:message></response>

(cmd) step_into -i 1

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="1" status="break" reason="ok"><xdebug:message
filename="/home/httpd/html/test/xdebug/bug270.php(3) : eval()&apos;d code"
lineno="1"></xdebug:message></response>

(cmd) step_into -i 1

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="1" status="break" reason="ok"><xdebug:message
filename="/home/httpd/html/test/xdebug/bug270.php"
lineno="4"></xdebug:message></response>

(cmd) step_into -i 1

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="1" status="break" reason="ok"><xdebug:message
filename="/home/httpd/html/test/xdebug/bug270.php"
lineno="6"></xdebug:message></response>

(cmd) step_into -i 1

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="1" status="stopped" reason="ok"></response>

----------------------------------------------------------------------
 albert66 - 2007-05-24 09:28 CEST
----------------------------------------------------------------------
I want to add a "bugnote". Then I'll close the bug.

----------------------------------------------------------------------
 albert66 - 2007-05-24 09:29 CEST
----------------------------------------------------------------------
I see.

So it has to do with something with my setup. I'll upgrade my PHP to the
latest version I can.

Thank you for your reply, Derick.

>
> I can not reproduce this with the bundled client:

(It has nothing to do with the client, BTW. I'm using Vim's plugin and it
fails too.)

BTW2,

I've found the following two reports, but they contain no clues:

http://issues.waterproof.fr/IssueView.php?Id=11067&activeItem=91
http://support.activestate.com/forum-topic/error-while-debugging-eva

----------------------------------------------------------------------
 albert66 - 2007-05-24 09:31 CEST
----------------------------------------------------------------------
(Hmmm... I don't know how to close the bug, sorry :-)

----------------------------------------------------------------------
 derick - 2007-05-26 21:56 CEST
----------------------------------------------------------------------
Could you try the latest CVS version perhaps? I committed a change to the
eval() handling code, as there was indeed something strange going on
there.

----------------------------------------------------------------------
 albert66 - 2007-05-29 17:22 CEST
----------------------------------------------------------------------
>
> Could you try the latest CVS version perhaps?
>

I've just tried. I get the same results. An 'eval()' call stops the
debugger.

(BTW, when I tried to compile this CVS version I got an error:

xdebug.c:2199: error: 'struct _php_core_globals' has no member named
'last_error_type'

I commented out this line and was able to proceed with the compilation.)

----------------------------------------------------------------------
 derick - 2007-05-30 19:35 CEST
----------------------------------------------------------------------
I fixed the compile error in CVS, but I can still not reproduce your error,
not even with PHP 5.0.4. Could you please make a remote debug log? (See
http://xdebug.org/docs/all_settings#remote_log on how to do that)

----------------------------------------------------------------------
 albert66 - 2007-06-01 03:49 CEST
----------------------------------------------------------------------
Derick, thanks.

I used the following test script:

<?php
print "111\n";
eval('print "222\n";');
print "333\n";
print "444\n";
print "555\n";
print "666\n";
?>

And got the following recording:

======================================

Log opened at 2007-06-01 01:34:08
-> <init xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
fileuri="file:///var/www/html/test.php" language="PHP"
protocol_version="1.0" appid="2336"><engine
version="2.0.0RC5-dev"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick
Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright
(c) 2002-2007 by Derick Rethans]]></copyright></init>

<- step_into -i 1
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="1" status="break" reason="ok"><xdebug:message
filename="/var/www/html/test.php" lineno="2"></xdebug:message></response>

<- step_into -i 1
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="1" status="break" reason="ok"><xdebug:message
filename="/var/www/html/test.php" lineno="3"></xdebug:message></response>

<- step_into -i 1

======================================

The last line, "step_into -i 1", was the command I issued when the
debugger was on line http://bugs.xdebug.org/bug_view_page.php?bug_id=0000003 (the line containing the eval() call). I get
nothing in response. The debugger front-end tells me the connection was
closed/disconnected.

Important: after this point the script continues to run normaly. I see
"111 222 333 444 555 666" in my browser.

----------------------------------------------------------------------
 albert66 - 2007-06-01 03:56 CEST
----------------------------------------------------------------------
BTW, what would happen if I used the 'dbg' or 'php3' protocols instead of
'dbgp'? Could it make any difference? Would it help you if you knew the
results?

(I'm not sure I have a debugger front-end to either of these two
protocols.)

----------------------------------------------------------------------
 derick - 2007-06-01 14:24 CEST
----------------------------------------------------------------------
I think I just fixed this in CVS. Feel free to reopen if the problem
re-appears.

Bug History
Date Modified Username Field Change
======================================================================
2007-05-21 10:15albert66 New Bug
2007-05-21 10:15albert66 Bug Monitored: albert66
2007-05-21 15:16albert66 Bugnote Added: 0000621
2007-05-22 22:59derick Bugnote Added: 0000627
2007-05-22 22:59derick Assigned To => derick
2007-05-22 22:59derick Resolution open => unable to duplicate
2007-05-22 22:59derick Status new => resolved
2007-05-24 09:28albert66 Bugnote Added: 0000628
2007-05-24 09:28albert66 Resolution unable to duplicate => reopened
2007-05-24 09:28albert66 Status resolved => feedback
2007-05-24 09:29albert66 Bugnote Added: 0000629
2007-05-24 09:31albert66 Bugnote Added: 0000630
2007-05-26 21:56derick Bugnote Added: 0000631
2007-05-29 17:22albert66 Bugnote Added: 0000640
2007-05-30 19:35derick Bugnote Added: 0000644
2007-06-01 03:49albert66 Bugnote Added: 0000646
2007-06-01 03:56albert66 Bugnote Added: 0000647
2007-06-01 14:24derick Bugnote Added: 0000648
2007-06-01 14:24derick Status feedback => closed
======================================================================
Received on Fri Jun 01 2007 - 14:24:11 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST