Skip to content
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

Segfault when resuming from xdebug breakpoint in PHPStorm (and maybe other places?) #4351

Closed
jaredkipe opened this issue Nov 28, 2014 · 25 comments

Comments

@jaredkipe
Copy link

Here is the contents of the stacktrace:

Host: app1
ProcessID: 18253
ThreadID: 7f2172fff700
ThreadPID: 18257
Name: unknown program
Type: Segmentation fault
Runtime: hhvm
Version: tags/HHVM-3.4.0-0-g817b3a07fc4e509ce15635dbc87778e5b3496663
DebuggerCount: 0


#0  folly::IOBuf::countChainElements() const at /usr/local/bin/hhvm:0
#1  apache::thrift::async::TAsyncSocket::writeChain(apache::thrift::async::TAsyncTransport::WriteCallback*, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >&&, apache::thrift::async::WriteFlags) at /usr/local/bin/hhvm:0
#2  HPHP::FastCGISession::writeStream(unsigned short, HPHP::FastCGISession::RecordType, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >) at /usr/local/bin/hhvm:0
#3  HPHP::FastCGITransaction::onStdOut(std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >) at /usr/local/bin/hhvm:0
#4  std::_Function_handler<void (), HPHP::FastCGITransport::sendImpl(void const*, int, int, bool)::{lambda()#1}>::_M_invoke(std::_Any_data const&) at fastcgi-transport.cpp:0
#5  folly::EventBase::runFunctionPtr(std::function<void ()>*) at /usr/local/bin/hhvm:0
#6  folly::EventBase::FunctionRunner::messageAvailable(std::pair<void (*)(void*), void*>&&) at /usr/local/bin/hhvm:0
#7  folly::NotificationQueue<std::pair<void (*)(void*), void*> >::Consumer::handlerReady(unsigned short) at /usr/local/bin/hhvm:0
#8  event_base_loop at /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5:0
#9  folly::EventBase::loopBody(int) at /usr/local/bin/hhvm:0
#10 folly::EventBase::loopForever() at /usr/local/bin/hhvm:0
#11 proxygen::WorkerThread::runLoop() at /usr/local/bin/hhvm:0
#12 std::thread::_Impl<std::_Bind_simple<proxygen::WorkerThread::start()::{lambda()#1} ()> >::_M_run() at WorkerThread.cpp:0
#13 std::this_thread::__sleep_for(std::chrono::duration<long, std::ratio<1l, 1l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) at /usr/lib/x86_64-linux-gnu/libstdc++.so.6:0
#14 start_thread at /lib/x86_64-linux-gnu/libpthread.so.0:0
#15 clone at /lib/x86_64-linux-gnu/libc.so.6:0

This MAY have been caused by an exception in a registered callback for __SystemLib\SessionForwardingHandler->close()

@Cholik
Copy link

Cholik commented Nov 28, 2014

Same here. Happens when I try to resume from a triggered xdebug breakpoint using PHPStorm.
Triggering the breakpoint works fine but only for the first time, hhvm hangs and terminates after some time with the same stacktrace. None of this happens if I use Codebug for xdebugging.

Host: developmentHWhhvm
ProcessID: 5656
ThreadID: 7f8b7bfff700
ThreadPID: 5664
Name: unknown program
Type: Segmentation fault
Runtime: hhvm
Version: tags/HHVM-3.4.0-0-g817b3a07fc4e509ce15635dbc87778e5b3496663
DebuggerCount: 0


# 0  folly::IOBuf::countChainElements() const at /usr/bin/hhvm:0
# 1  apache::thrift::async::TAsyncSocket::writeChain(apache::thrift::async::TAsyncTransport::WriteCallback*, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >&&, $
# 2  HPHP::FastCGISession::writeStream(unsigned short, HPHP::FastCGISession::RecordType, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >) at /usr/bin/hhvm:0
# 3  HPHP::FastCGITransaction::onStdOut(std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >) at /usr/bin/hhvm:0
# 4  std::_Function_handler<void (), HPHP::FastCGITransport::sendImpl(void const*, int, int, bool)::{lambda()#1}>::_M_invoke(std::_Any_data const&) at fastcgi-transport.cpp:0
# 5  folly::EventBase::runFunctionPtr(std::function<void ()>*) at /usr/bin/hhvm:0
# 6  folly::EventBase::FunctionRunner::messageAvailable(std::pair<void (*)(void*), void*>&&) at /usr/bin/hhvm:0
# 7  folly::NotificationQueue<std::pair<void (*)(void*), void*> >::Consumer::handlerReady(unsigned short) at /usr/bin/hhvm:0
# 8  event_base_loop at /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5:0
# 9  folly::EventBase::loopBody(int) at /usr/bin/hhvm:0
# 10 folly::EventBase::loopForever() at /usr/bin/hhvm:0
# 11 proxygen::WorkerThread::runLoop() at /usr/bin/hhvm:0
# 12 std::thread::_Impl<std::_Bind_simple<proxygen::WorkerThread::start()::{lambda()#1} ()> >::_M_run() at WorkerThread.cpp:0
# 13 std::this_thread::__sleep_for(std::chrono::duration<long, std::ratio<1l, 1l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) at /usr/lib/x86_64-linux-gnu/libst$
# 14 start_thread at /lib/x86_64-linux-gnu/libpthread.so.0:0
# 15 clone at /lib/x86_64-linux-gnu/libc.so.6:0

@jaredkipe
Copy link
Author

I got a second identical crash. I grow more certain that it is related to an exception (deadlock) in session callback.

@MaXal
Copy link

MaXal commented Dec 31, 2014

Same in HHVM 3.4.2.

@jaredkipe
Copy link
Author

FWIW I 'moved' the sessions to Redis and this went away. (I didn't intend the sessions to be in the DB, it was a regression in a config file).

I'm more or less certain that this was caused by an exception (deadlock due to galera cluster) in the db based session implementation. Most likely an/the exception is not expected in a registered session callback handler.

@jwatzman
Copy link
Contributor

  • This happens with any breakpoint, in any project? (Trying to get a repro case.)
  • Have you tried with the recently released 3.5?

@roman-shuhov
Copy link

happens in any project with any type of breakpoint
also happens in 3.5.0

@jwatzman jwatzman changed the title Segfault crash 3.4.0 Segfault when resuming from xdebug breakpoint in PHPStorm (and maybe other places?) Jan 27, 2015
@jwatzman
Copy link
Contributor

Sounds like we have some consistent reports. The xdebug/phpstorm thing is worth looking into when we get some time -- the issue seems to happen with more than just that, but it sounds like a consistent repro.

@sobit
Copy link

sobit commented Jan 28, 2015

happens to me also on remote debugging using phpstorm. my steps are:

  1. catch a breakpoint
  2. stop debugging in phpstorm
  3. run the script again

at this point hhvm is stopped and not responding anymore.

@SvetlanaZem
Copy link

Hello, I'm working on debugger integration in PhpStorm and I'll be happy to provide you any information that will help to fix the issue. So if you need any assistance feel free to contact me.

@RoyHP
Copy link

RoyHP commented Mar 4, 2015

I am also having this problem, with the same steps using phpstorm.

@jwatzman
Copy link
Contributor

jwatzman commented Mar 4, 2015

@paulbiss do you know if anyone is actively working on xdebug? Might be useful to take up @SvetlanaZem's offer if someone is, though I suspect we don't have anyone with the spare time right now?

@paulbiss
Copy link
Contributor

paulbiss commented Mar 4, 2015

@alexmalyshev is working on hphpd, and had been looking at Xdebug as a potential replacement. I think he handed off the Xdebug work to the IDE folks, but he may know who was looking at it most recently anyway.

@RoyHP
Copy link

RoyHP commented Mar 9, 2015

If they are useful, I have attached HHVM's xdebug logs to the PhpStorm issue WI-26478 (https://youtrack.jetbrains.com/issue/WI-26478). I think @SvetlanaZem believes this is an issue with HHVM. Let me know if there's anything you want me to test.

@SvetlanaZem
Copy link

There are three responses for a single "breakpoint_set" command in xdebug.log files provided by @RoyHP Anyway it looks like another problem, please let me know if I should create separate issue.

@RoyHP
Copy link

RoyHP commented Mar 31, 2015

@jwatzman Someone is reporting this issue is not only limited to PHPStorm, but also happening with MacGDBp. They are commenting on the issue I created with PHPStorm in my last comment.

@MaXal
Copy link

MaXal commented May 7, 2015

Issue is still there for HHVM 3.7.0.

@bheyser
Copy link

bheyser commented May 8, 2015

I can also confirm the issue:

happens after resuming from a breakpoint

@robertodormepoco
Copy link

same here with HHVM 3.7.0/Nginx with PhpStorm EAP or 8.0.*

the xdebug communication works quite well in Eclipse Luna 4.4, mainly because xdebug and the later talk with a different sequence of communication steps that was a misleading thought see my last comment

@robertodormepoco
Copy link

please see my colleague's comment about hhvm xdebug read buffer handling

@jwatzman jwatzman self-assigned this Jun 18, 2015
@jwatzman
Copy link
Contributor

Can someone who was having this problem try it again with the latest nightly build of HHVM? #4488 has been fixed and I wonder if this is too.

@RoyHP
Copy link

RoyHP commented Jun 29, 2015

@jwatzman Someone on #4488 is having a new problem. I haven't tried it yet myself, and won't get the chance for a while.

@jwatzman jwatzman removed their assignment Jul 6, 2015
@jwatzman
Copy link
Contributor

jwatzman commented Jul 6, 2015

Leaving this open until confirmed fixed, but won't be personally working on it right now.

@euphio
Copy link

euphio commented Sep 30, 2015

The problem still exists for us when remote debugging to a Vagrant box:

  • Ubuntu 14.04
  • PhpStorm 9.0.2
  • HHVM 3.9.2

Resuming from a breakpoint intermittently causes a segfault.

@paulbiss
Copy link
Contributor

Is anyone still seeing this? The recent work on xdebug for nuclide debugging support fixed a lot of hard to find bugs.

@mofarrell
Copy link
Contributor

Closing. Needs more info. (https://github.com/facebook/hhvm/wiki/Human-Timeouts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests