Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000963XdebugUsage problemspublic2013-07-15 15:562013-12-03 00:13
Reporteralexey.bakulin 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinux x86_64OSUbuntuOS Version13.04
Product Version2.2.1 
Target VersionFixed in Version2.2.4 
Summary0000963: Xdebug wait response from remote client and hang up apache php mod
DescriptionI have Apache web server with setup php 5.4 module. Server run on Ubuntu 13.04 Server on VirtualBox vm. I work on PhpStrom 6.0.3 on Windows 8.
Also I use "Xdebug helper" plugin for Chrome browser.
So, I use Xdebug for remote debugging im my IDE.
If I try to run any php script through browser and do not run the debug listener in IDE, xdebug hang up my request on a few minutes and wait response from debug client(IDE).
Message in log file:
Log opened at 2013-07-15 14:47:52
I: Connecting to configured address/port: 10.7.0.36:9000.
E: Could not connect to client. :-(
Log closed at 2013-07-15 14:49:59

Only after that I can get response from server.

Config for xdebug in php.ini:

xdebug

xdebug support => enabled
Version => 2.2.1
IDE Key => XDEBUG_PHPSTORM

Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.145 $

Directive => Local Value => Master Value
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.idekey => XDEBUG_PHPSTORM => XDEBUG_PHPSTORM
xdebug.max_nesting_level => 250 => 250
xdebug.overload_var_dump => On => On
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_output_dir => /tmp => /tmp
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_autostart => Off => Off
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => 10.7.0.36 => 10.7.0.36
xdebug.remote_log => /var/log/php-xdebug.log => /var/log/php-xdebug.log
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.scream => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_enable_trigger => Off => Off
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /tmp
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3
Steps To Reproduce1. Configure xdebug for remote debugginng on a specify address/port.
2. Switch off xdebug listener in IDE.
3. Try to run any php script trough browser.
TagsNo tags attached.
Operating SystemUduntu 13.04 Server
PHP Version5.4.9
Attached Files

- Relationships
has duplicate 0000805resolvedderick Make debugger's timeout period configurable 

-  Notes
(0002536)
alexey.bakulin (reporter)
2013-07-15 15:58

reproduce for me with config xdebug.remote_connect_back => On => On too.
(0002551)
mike503 (reporter)
2013-08-03 00:17

Pretty sure this is what I was going to try to report as well.

If port 9000 is not available on the client machine, depending on how the network stack rejects it, PHP will stall out infinitely until the webserver timeout occurs.

For example, my desktop port 9000 instantly returns connection refused - that's fine.

A bunch of my coworkers' desktops port 9000 doesn't return back a connection refused. So it hangs there.

Perhaps adding in a "xdebug.remote_connect_back_timeout" variable would be nice? So it can be set to 1-2 seconds or maybe even make it use microseconds. Then it can gracefully timeout even if it's not getting a strict "connection refused" - otherwise it seems to stay open indefinitely until the webserver hangs up the FastCGI connection.

My config:

zend_extension = /usr/lib/php5/20100525/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.collect_param = 2
xdebug.max_nesting_level = 500

PHP 5.4.17 from ondrej/php5-oldstable, Ubuntu 12.04.2 precise x86_64
(0002574)
derick (administrator)
2013-10-09 19:37

I can not reproduce this myself. What I would need to debug this is to see a communication session with both strace and wireshark. Is that something you can get me?
(0002622)
mac_cain13 (reporter)
2013-11-26 23:04

Hi Derick,

I'm the developer of the Xdebug extension for Chrome/Safari and I got a issue report on Github that looks an awful lot like this issue reported here. See: https://github.com/mac-cain13/xdebug-helper-for-chrome/issues/37 [^]

Now I did some testing myself and it seems that mike503 is right about the connection rejection and how it relates to PHP scripts hanging.

So if something (non-Xdebug stuff) is listening on port 9000 or the firewall is in stealth mode blocking all trafiic and NOT explicitly refusing the connection Xdebug will stall the PHP script waiting for a timeout. The timeout will only happen after quite some time and render things unusable.

I think it would be great if you can update the Xdebug FAQ to state this so people can take action (change firewall ruled for example). Also the proposed "xdebug.remote_connect_back_timeout" would be great to make Xdebug continue after a few seconds if the connection won't succeed.
Would this be something you can consider to add to the Xdebug config/FAQ?

If you need more info/traces let me know, I'll see what I can do!
(0002623)
derick (administrator)
2013-12-03 00:13

Not quite tested on Windows though!

- Issue History
Date Modified Username Field Change
2013-07-15 15:56 alexey.bakulin New Issue
2013-07-15 15:58 alexey.bakulin Note Added: 0002536
2013-08-03 00:17 mike503 Note Added: 0002551
2013-10-09 19:37 derick Note Added: 0002574
2013-10-14 01:32 derick Assigned To => derick
2013-10-14 01:32 derick Status new => feedback
2013-11-26 23:04 mac_cain13 Note Added: 0002622
2013-12-03 00:13 derick Note Added: 0002623
2013-12-03 00:13 derick Status feedback => closed
2013-12-03 00:13 derick Resolution open => fixed
2013-12-03 00:13 derick Fixed in Version => 2.2.4
2014-02-27 19:21 derick Relationship added has duplicate 0000805


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker