-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: fatal error: runtime: mcall called on m->g0 stack
while concurrently fetching /profile and /trace
#70454
Comments
More notes:
|
fatal error: runtime: mcall called on m->g0 stack
while concurrently fetching /profile and /tracefatal error: runtime: mcall called on m->g0 stack
while concurrently fetching /profile and /trace
CC @golang/runtime |
Here's the head of the log file:
Maybe this is the I'm not sure at the moment if |
Nice catch @rhysh! I can confirm that the below patch makes what was a reliable repro that ~always hit within 1,000 runs to not happening in 10,000 runs. I'll leave it to the runtime experts to decide whether that's the appropriate fix.
|
I don't have an explanation for how Looks like @mknyszek is on it, I'll leave it there. |
I added a bit of logging to the point that before |
Go version
go version go1.23.3 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Run the attached go program, which does some computation, and exposes profiling endpoints.
Fetch the cpu profile, and while it is being captured, fetch execution trace. Specifically to programmatically assure that cpu profile collection has started, hit the profile endpoint twice, expect one to fail with 500 error (only one profile can be captured concurrently), and then immediately start capturing the trace.
Repeat many times to reproduce the issue.
Attached is the go program code, and a rust binary that will repeatedly launch this program, and hit the profiling endpoints. I tried writing a go program to fetch the profiles, but it doesn't seem to repro, I suspect that race condition is subtle. The rust program has a concurrency target set to 32, problem seems to repro when all cores are busy.
Unpack the zip and:
repro.zip
$ go build fib.go
$ cargo run test
What did you see happen?
Sometimes the go program ends up crashing.
Output:
err.txt
What did you expect to see?
Successfully produced profiles without crashing.
The text was updated successfully, but these errors were encountered: