-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: hang in StopTrace in runtime.test #39004
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
cc @mknyszek |
The issue is that the M that stops tracing may be the only one awake. If it is locked, then it will call stoplockedm before checking that it needs to wake the trace reader: https://github.com/golang/go/blob/master/src/runtime/proc.go#L2551-L2597 A rudimentary trace I made:
The reader is woken once, but when it is time to shutdown ("wait for shutdown"), the reader is never woken. It may make sense to move the trace check (and perhaps GC worker as well?) before stoplockedm, or perhaps we should make some more fundamental change. (Why can't StopTrace call wakep directly?) cc @aclements |
Change https://golang.org/cl/233417 mentions this issue: |
Rolling forward to 1.16. |
Not a new issue and we don't really have a fix, so pushing to 1.17. |
Shall we just move this to Backlog? |
Change https://go.dev/cl/393880 mentions this issue: |
Forgot to mention, but I can't reproduce the original problem after https://go.dev/cl/393880. |
Passing -trace to
go test runtime
often (but not always) makes the test hang on exit, stuck in runtime.StopTrace / runtime.ReadTrace.The immediate issue seems to be LockOSThread in init (https://github.com/golang/go/blob/master/src/runtime/runtime_linux_test.go#L24), as the issue goes away if that is removed.
The text was updated successfully, but these errors were encountered: