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: deadlock/livelock in GC code #28695
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
Run top and you will see 1 out of a thousand or so invocations of issue27695 hanging.
This should be a good starting place.
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