View Issue Details

IDProjectCategoryView StatusLast Update
0000774XdebugUncategorizedpublic2012-04-22 13:48
Reporterthaddeusmt Assigned Toderick  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformWindows 7 64OSWindows 7 64OS VersionWindows 7 64
Target Version2.2.0Fixed in Version2.2.0RC2 
Summary0000774: Apache crashes on POST requests when using xdebug
Description

Using PhpStorm to debug with Xdebug, the same way I have for almost a year now, crashes Apache (with the new 2.1.3 release) on POST requests when the XDEBUG_SESSION cookie (or the XDEBUG_SESSION_START get parameter) is set.

I had been waiting for the new Windows Binary for a while, excited to get the inherited-private property bug fixed!! But alas. :)

Steps To Reproduce

Apache runs fine and everything works (including POST requests) until I set the XDEBUG_SESSION=PHPSTORM cookie.

When I do this, it actually starts to debug and I can use breakpoints, inspect the POST array, and everything seems to work - but at the end Apache crashes and restarts, and the browser gets no response back from the server.

The same thing happens when using the XDEBUG_SESSION_START parameter.

Additional Information

PHPSTORM XDEBUG SESSION SETTER SCRIPT:
javascript:(/* @version 0.5.1 /function() {document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';})()

XDEBUG CONFIG:
zend_extension = "c:/wamp32/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.3-5.3-vc9.dll"
xdebug.remote_enable = On
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_output_dir = "c:/wamp32/tmp"
xdebug.remote_log="c:/wamp32/logs/xdebug.log"

APACHE CRASH LOG:

[Thu Feb 02 21:15:27 2012] [notice] Parent: child process exited with status 4294967295 -- Restarting.
[Thu Feb 02 21:15:28 2012] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/0.9.8r PHP/5.3.8 configured -- resuming normal operations
[Thu Feb 02 21:15:28 2012] [notice] Server built: Sep 10 2011 11:34:11
[Thu Feb 02 21:15:28 2012] [notice] Parent: Created child process 13572
[Thu Feb 02 21:15:28 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Feb 02 21:15:29 2012] [notice] Child 13572: Child process is running
[Thu Feb 02 21:15:29 2012] [notice] Child 13572: Acquired the start mutex.
[Thu Feb 02 21:15:29 2012] [notice] Child 13572: Starting 64 worker threads.
[Thu Feb 02 21:15:29 2012] [notice] Child 13572: Starting thread to listen on port 80.
[Thu Feb 02 21:15:29 2012] [notice] Child 13572: Starting thread to listen on port 80.

XDEBUG LOG:

Log opened at 2012-02-03 03:16:39
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/xampp/htdocs/stdev1/multiuser/index.php" language="PHP" protocol_version="1.0" appid="13572" idekey="PHPSTORM"><engine version="2.1.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]></copyright></init>

<- feature_set -i 0 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="0" feature="show_hidden" success="1"></response>

<- feature_set -i 1 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1"></response>

<- feature_set -i 2 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response>

<- step_into -i 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="3" status="break" reason="ok"><xdebug:message filename="file:///C:/xampp/htdocs/stdev1/multiuser/index.php" lineno="2"></xdebug:message></response>

<- eval -i 4 -- aXNzZXQoJF9DT09LSUVbJ1BIUFNUT1JNX1hERUJVR19CUkVBSyddKQ==
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="4"><property address="67893676" type="bool"><![CDATA[0]]></property></response>

<- eval -i 5 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="5"><property address="67893676" type="bool"><![CDATA[1]]></property></response>

<- eval -i 6 -- JF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10=
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="6"><property address="67893676" type="string" size="10" encoding="base64"><![CDATA[c2xkZXYyLmRldg==]]></property></response>

<- eval -i 7 -- JF9TRVJWRVJbJ1NFUlZFUl9QT1JUJ10=
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="7"><property address="67893676" type="string" size="2" encoding="base64"><![CDATA[ODA=]]></property></response>

<- eval -i 8 -- JF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10=
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="8"><property address="67893676" type="string" size="44" encoding="base64"><![CDATA[L3BhZ2UvMDAwMDAwMDAwMDAxL3RhYi9uZXdQb3N0P3VybD10ZW1wbGF0ZTE=]]></property></response>

<- stack_get -i 9
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="9"><stack where="{main}" level="0" type="file" filename="file:///C:/xampp/htdocs/stdev1/multiuser/index.php" lineno="2"></stack></response>

<- run -i 10

TagsNo tags attached.
Operating SystemWindows 7 64
PHP Version5.3.4

Activities

derick

2012-03-07 19:43

administrator   ~0001952

Could you supply the script that's running too?

thaddeusmt

2012-03-13 01:58

reporter   ~0001982

I've tracked it down a little more: the POST does not seem to be the issue, it's header() redirects which are followed by an exit() statement. All of the code executes just fine and I can trace through it with the debugged, but when there is a PHP header() redirect followed by and exit() it fails to redirect and crashes Apache. So, a code like this:

header('Location: http://mylocalserver.dev', true, 302);
exit();

I just revisited this today with 2.1.4 and it still happens.

Also, it happens with any combo of codes and parameters I have tried, including the basic:

header('Location: http://mylocalserver.dev');
exit();

The Yii framework I use does it's redirects this way and it's worked before - it just crashes with this new xdebug version.

Thanks and cheers

akger1379

2012-03-24 09:11

reporter   ~0002003

I can confirm this problem. Using PHPStorm on WinXP and running all my web applications on Apache 2.x | PHP 5.3.6 (CGI) | Xdebug 2.2.0rc1 on Ubuntu (VirtualBox).

When debugging with Xdebug redirects with the header() function ending up in a 500 - Internal Server Error. Apaches error.log is telling me:
"Premature end of script headers: php-cgi, refe..."

derick

2012-03-24 23:44

administrator   ~0002011

Can you please provide the exact script that matches a debug log? It helps a lot if I know exactly what you're doing. Please attach both the script and the remote_log for just one run that shows the crash.

akger1379

2012-03-25 08:44

reporter   ~0002013

just try the folling simple example to reproduce the behavior:

<?php
$someVar = 'someVal';
header('Location: index.php');
exit(0);
?>

if you debug this script (at least in my environment) the browser will show a 500 internal server error and the apache error.log gets the above mentioned entry. hope that helps.

derick

2012-03-26 21:48

administrator   ~0002021

Fixed for 2.1.4 and 2.2.0.

Issue History

Date Modified Username Field Change
2012-02-03 03:36 thaddeusmt New Issue
2012-03-07 19:43 derick Note Added: 0001952
2012-03-07 19:43 derick Assigned To => derick
2012-03-07 19:43 derick Status new => feedback
2012-03-13 01:58 thaddeusmt Note Added: 0001982
2012-03-13 01:58 thaddeusmt Status feedback => assigned
2012-03-24 09:11 akger1379 Note Added: 0002003
2012-03-24 23:44 derick Note Added: 0002011
2012-03-24 23:44 derick Status assigned => feedback
2012-03-25 08:44 akger1379 Note Added: 0002013
2012-03-26 21:48 derick Fixed in Version => 2.2.0
2012-03-26 21:48 derick Target Version => 2.2.0
2012-03-26 21:48 derick Note Added: 0002021
2012-03-26 21:48 derick Status feedback => closed
2012-03-26 21:49 derick Resolution open => fixed
2012-04-22 13:48 derick Fixed in Version 2.2.0 => 2.2.0RC2
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