-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http/pprof: coroutines + pprof makes the program panic #69998
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 seems like a real bug. |
Ah, yikes. The goroutine profile expects every time a goroutine is about to start running that it checks to see if it needs to be profiled. We do not do this on the coroutine resume path. It's an easy fix, I'll send a patch. |
@gopherbot Please open a backport issue for Go 1.23. This causes crashes with no workaround when trying to take a goroutine profile in a program that uses |
Backport issue(s) opened: #70001 (for 1.23). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/622016 mentions this issue: |
Oh no. This is actually quite a bit more annoying because the |
Just kidding, the problem was actually relative minor. The fix seems OK now. |
Change https://go.dev/cl/622375 mentions this issue: |
…in coroswitch Goroutine profiles require checking in with the profiler before any goroutine starts running. coroswitch is a place where a goroutine may start running, but where we do not check in with the profiler, which leads to crashes. Fix this by checking in with the profiler the same way execute does. For #69998. Fixes #70001. Change-Id: Idef6dd31b70a73dd1c967b56c307c7a46a26ba73 Reviewed-on: https://go-review.googlesource.com/c/go/+/622016 Reviewed-by: David Chase <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> (cherry picked from commit 2a98a18) Reviewed-on: https://go-review.googlesource.com/c/go/+/622375 Reviewed-by: Michael Pratt <[email protected]>
Go version
go version devel go1.24-d0631b90a3 Wed Oct 23 04:48:55 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Run this program:
What did you see happen?
I either see:
Or:
What did you expect to see?
No panic.
Removing the coroutines immediately fixes the issue.
The text was updated successfully, but these errors were encountered: