-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: TestCallersDeferNilFuncPanic failed in generating traceback (linux/arm64) #36050
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
Yes, that is fine.
Posting the full stack trace that the program fails with would help. It would be nice to find a way to get the test to fail by itself. If it fails during a GC interrupt (probably, but hard to tell without the full error log), using GOGC=1 will help tickle that bug. Also running the test in multiple goroutines simultaneously might also help. |
Thanks @randall77. ============================================================== runtime stack: goroutine 35 [running]: goroutine 1 [chan receive, locked to thread]: goroutine 2 [force gc (idle)]: goroutine 3 [GC sweep wait]: goroutine 4 [GC scavenge wait]: goroutine 18 [finalizer wait]: |
@shawn-xdji thanks for the bug report and the stack trace. I can reproduce this always with debug compilation of the individual runtime test on a linux-arm64 gomote:
The issue is that we are calling gentraceback() with a callback in order to look for the next open-coded defer frame to process in the panic case. But calling gentraceback() with a callback on arm64 (lr architectures) throws an error if jmpdefer is on the stack (because jmpdefer register manipulation is non-atomic). This only happens in the one case where the defer pointer is null, since then there is a seg fault on the jmpdefer instruction that jumps though the defer pointer. Also, it only happens if stack-allocated defers are used (since open-coded defers don't use jmpdefer), hence why this only happens when debug flags are enabled. The simplest fix is to force the seg fault to happen in deferreturn() just before the jmpdefer(). This will cause one extra load in cases when jmpdefer is used, but that is now rare, since stack-allocated defers are now rare. |
Thanks a lot @danscales , I could reproduce the issue using your command line. Just out of curiosity, why setting GO_GCFLAGS failed to reproduce the issue? Both the following two work fine. GO_GCFLAGS=all='-N -l' go test -run=TestCallersDeferNilFuncPanic runtime |
|
Change https://golang.org/cl/210978 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Reproducible with the tip.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
cd /src
GO_GCFLAGS='-N -l' ./all.bash
What did you expect to see?
building passes.
What did you see instead?
Testing of runtime package failed:
fatal error: traceback_arm: found jmpdefer when tracing with callback
It turns out TestCallersDeferNilFuncPanic triggers the error in function 'gentraceback', so far I could reproduce the issue with running './all.bash' only, both 'go test ...' and 'go tool dist test' works fine.
My questions:
Thanks a lot.
The text was updated successfully, but these errors were encountered: