runtime: fpTraceback
fails when trying to take a stack trace of a goroutine in a syscall
#66889
Labels
fpTraceback
fails when trying to take a stack trace of a goroutine in a syscall
#66889
After https://go.dev/cl/567076 (for #65634) landed, the runtime began trying to take the frame-pointer-based stack trace of a goroutine in a syscall. Turns out, the runtime had never tried to this before, and it's totally broken.
The main issue is that
traceStack
tries to usegp.sched.bp
but that's not even set when entering a syscall. Worse still,gp.sched
in general could get clobbered by callingsystemstack
. It can then get updated again when switching back to the Go stack (since the syscall path wants to undo the clobbering).For now, I'm just going to disable getting a stack trace for goroutines blocked in a syscall for the entirety of a generation. To resolve this, what we really need is a
gp.syscallbp
, akin togp.syscallpc
andgp.syscallsp
. The latter two are already used by the regular stack unwinder if available, and they're actually stable, as opposed togp.sched
which gets mutated. Implementing that will be a bigger change, so I'm putting that on the backburner.The text was updated successfully, but these errors were encountered: