New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd behaviour with Vagrant, PHPStorm and Xdebug #4488
Comments
I have very similar issue with hhvm debug. My xdebug configuration is following: xdebug.enable = 1
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9999
xdebug.remote_host = "172.16.97.1" I'm using PHPStorm 8.0.3. When I try to debug php project with just a checkbox "Break at first line in PHP Scripts" it works fine. But, if i try to put any breakpoint in the code, HHVM just hangs and doesn't respond. It starts work again only after HHVM restart. Moreover, if i set breakpoint after PHPStorm breaks at the first line, and remove this breakpoint before script ends, hhvm works fine. VM is 14.04 with Apache + HipHop VM 3.5.0 I also got exception report in my logs:
|
that's also probably related to #4351 |
My experience with this lead me to believe it was more likely a hang, than irrecoverable crash, due to the weird hack I explained above. @roman-shuhov try setting a breakpoint very early in the code (first couple of lines), wait for the incoming connection to be recognised by PhpStorm and then everything should hang. After this click the "Add method to skip list" button on the debug panel 20-30 times and see if it comes back to life. |
I'm experiencing 2 types of errors:
I also see a lot of warnings: "\nWarning: Could not start xdebug server. Check the remote debugging log for details", but looks like it only happens when phpstorm is not waiting for incoming connections. Our team is really excited to use hhvm, but buggy debugger is a really big problem for us. Hope this information helps, let me know if you need more information. |
@roman-shuhov your issue looks identical to #4351, we can continue over there. @euphio It sounds like you think HHVM is hanging, but not crashing? Can you attach |
I am also having the same problem. Here is my stacktrace.
|
ProblemPHPStorm sends commands without waiting for a response. The bug is that HHVM only replies to one of those responses because the tcp read buffer is naive. Workaround proofWrite a proxy that enforces PHPStorm to wait for the response from HHVM before sending a new request:
Let HHVM xdebug connect to this proxy, and the proxy to your IDE. It will work. Note: this is a workaround for a proof, not a complete workaround because some commands may not work (e.g. setting breakpoints while running the program). ReproducingCreate a fake IDE server that accept connections directly from xdebug:
Now create an xdebug.txt to simulate IDE commands like this:
Start the fake server with:
Now let HHVM connect to the fake server. Note that HHVM only replies to one of the responses:
Uncomment the SolutionFix the read buffer of Quick fix:
|
@jwatzman I haven't tested this in the comment above, but it sounds like what is happening. |
Thanks! Not sure when someone will get to this, but the info above looks super useful, really appreciate it. |
Did anyone have a chance to finally fix this issue? I think a lot of developers are waiting for the ability to debug code with hhvm... |
@jwatzman given that the current state is half broken, what about applying that one-line quick fix until the read buffer is rewritten properly? The only counter argument would be reading 1 byte at time from the socket which is in general slow, but talking about commands given by an IDE I wouldn't bother about this overhead. |
@lethalman yeah, I think we'd probably take that patch -- can you send a PR? |
I think I have a proper fix for this under review internally (D2170147). |
I just built 3.8.0-dev still seems to have issues. It connected once with PhpStorm 8.0.3 and seemed to work for a minute. I checked the HHVM error log and I get
|
@lbadger can you file a new issue for that? The issue here of "HHVM hangs when using PHPStorm's XDebug support" has been fixed. |
I'm having problems getting PhpStorm and the internal Xdebug in HHVM playing nicely on a vagrant box, so thought I'd post this here as it looks like a potential bug.
PhpStorm is listening on Port 9080, if I remove all remote servers upon first run PhpStorm gives me the usual "Incoming Connection from Xdebug".
After I select the correct mapping and the first breakpoint is hit HHVM appears to hang before returning a 504 Gateway Time-out. If I remove the breakpoint then the load is instant, so clearly the PhpStorm and Xdebug appear to be communicating, but the debug window never shows any stack info / break point controls.
I'm on Ubuntu 14.04, Vagrant 1.6.5, PhpStorm 8.0.2
VM is also 14.04 with Nginx + HipHop VM 3.4.1, Extension API: 20140829
php.ini xdebug settings.
Below is the output from the xdebug remote connection log before the halt:
After this a very peculiar thing happens though, if I click the "Add method to skip list" button in PhpStorm, It continues communicating with Xdebug as if stepping through variables, one with each click, for example:
Eventually the expected controls are shown after several of these "stack_get" calls have been hackily stepped through in this manner.
The text was updated successfully, but these errors were encountered: