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
runtime: async preemption still fail for pure tight loop #35923
Comments
/cc @aclements |
Maybe it's because that anonymous function is nosplit here?
|
It seems that all leaf functions with small stack will be treated as nosplit function. |
This is definitely incorrect. There are various non-preemptible regions, which are marked with -2. There is a known issue that the very last instruction in a function is marked non-preemptible. For this particular function, that is the loop back-edge, making the empty loop hardly preemptible (which we should fix). However, it should be more preemptible in real code with non-empty loops. |
@cherrymui |
@changkun The failure would be sporadic, not deterministic. You may need to run multiple times to see a failure. Also, it may be more likely to fail on some architectures than others. |
Change https://golang.org/cl/209659 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, current tip
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tested the current tip, and the async preemption remains to fail in a very simple case:
I debugged a little and the issue is caused by the following check
go/src/runtime/preempt.go
Line 397 in 8054b13
Deleting this
if
the check seems can fix the preemption for the example and pass all tests as well.What did you expect to see?
Many
OK
What did you see instead?
Nothing appears.
The text was updated successfully, but these errors were encountered: