-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: deadlock/livelock in GC code #28695
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
Comments
This is a deadlock between thread 7, which is attempting to force all Ps to a safe point, and thread 3, which must be trying to scan thread 7's user stack. Since neither can preempt the other, they're stuck.
So, the cause is clear. The fix is less so. It would be much better if all of these preemption operations were asynchronous; we've had plenty of other similar deadlocks in the past. To fix this bug, it may be enough to allow preemption of |
@aclements feel free to re-assign as you see fit. |
I was able to reproduce and I think I have a fix. As soon as I can confirm it fixes the issue I'll put it up for review. |
Change https://golang.org/cl/153077 mentions this issue: |
Running the same program @RLH mentioned above, I'm at 35k iterations with no stale (deadlocked) processes, so hopefully this means its fixed. :) |
The GC appears to be deadlock. The test in issue27695.go triggers it though the test seem unrelated to the deadlock.
Noticed this running go/test/fixedbugs/issue27695.go from the standard distribution.
Once every 1000 or so runs it hangs. The easiest way to make this happen is to run
GOTRACEBACK=crash stress ../test/fixedbugs/issue27695
Run top and you will see 1 out of a thousand or so invocations of issue27695 hanging.
Grab the PID of one of the hung executions and run gdb and dump all the threads.
This should be a good starting place.
The text was updated successfully, but these errors were encountered: