Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: all thread is block in runtime.futex，service is hanging，may be deadlock #22398
The crash is saying that some thread tried to extend the g0 stack, which is impossible and should never happen. Unfortunately for some reason there isn't enough information there to see what caused that to happen.
I don't understand why you say that this is a deadlock, when it looks like a crash.
Sorry, when I said that extending the g0 stack is impossible, I didn't mean to imply that it wasn't happening here. What I mean is that the runtime is designed to never try to extend the g0 stack. It appears that something has gone wrong, but I don't know what.
Passing -1 as the timeout to futex doesn't mean block forever, it means block until something wakes up the futex.
It is entirely normal for most threads in a Go program to be blocked on a futex. There just has to be at least one thread running to keep the program going. And your program must have had at least one thread going, because that thread crashed.
That said, I don't know how you attached gdb to a crashed program, so there is certainly something I don't understand. In general I don't understand what you saw and I don't understand what you are reporting.
Please answer these two questions.
Did your program crash before you started using gdb?
Did your program get into a deadlock before you started using gdb?
If the answer to these questions are "no" and "yes", then the next question is: why do you think the deadlock is a bug in the Go runtime rather than in your program?
I just want kown the reason cause this phenomenon。
Have you run your program under the race detector? (https://blog.golang.org/race-detector).
The Go runtime does change in each release. The fact that your program worked on Go 1.6 doesn't necessarily mean that your program is correct.
There are many many different ways that a program can deadlock.
Looking at your stack trace I see a several goroutines sleeping for 0.8 seconds. That doesn't seem like a deadlock.
It's completely normal for all threads to be sleeping on a futex. That is exactly what I would expect to see if several goroutines are sleeping waiting for something to happen.