-
Notifications
You must be signed in to change notification settings - Fork 18k
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: runtime.Caller returns invalid zero frame #24108
Comments
@gopherbot please open a backport tracking issue, as this is a 1.10 regression. |
Backport issue(s) opened: #25041 (for 1.10). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
On examining the history of the runtime.Caller edits in extern.go [1]
$ go run main.go
devel +0ea120a70c Tue Apr 18 19:56:30 2017 +0000
4717371 /home/emmanuel/Desktop/opensrc/bugs/golang/24108/main.go 24 true main.st.M
4718642 <autogenerated> 1 true main.(*st).M
4718747 <autogenerated> 1 true main.(*wrapper).M
4717275 /home/emmanuel/Desktop/opensrc/bugs/golang/24108/main.go 15 true main.missingFunction
4717145 /home/emmanuel/Desktop/opensrc/bugs/golang/24108/main.go 11 true main.main
4359668 /home/emmanuel/go/src/go.googlesource.com/go/src/runtime/proc.go 185 true runtime.main
4524096 /home/emmanuel/go/src/go.googlesource.com/go/src/runtime/asm_amd64.s 2347 true runtime.goexit
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4402e2]
goroutine 1 [running]:
main.st.M()
/home/emmanuel/Desktop/opensrc/bugs/golang/24108/main.go:25 +0xaf
main.(*st).M(0x533078)
<autogenerated>:1 +0x33
main.(*wrapper).M(0xc42000e2a0)
<autogenerated>:1 +0x3c
main.missingFunction()
/home/emmanuel/Desktop/opensrc/bugs/golang/24108/main.go:15 +0x6c
main.main()
/home/emmanuel/Desktop/opensrc/bugs/golang/24108/main.go:11 +0xba
exit status 2
|
I've spent a while thinking about this one now, and I'm worried we've managed to back ourselves into a corner with the skip count and how tracebacking is currently structured. The logic behind ignoring frames in It's hard to make these agree. I would love to make stack unwinding internally demand-driven (not unlike As a stop-gap, it may be possible to keep The exact same problem affects |
This should now be fixed by https://go-review.googlesource.com/c/go/+/152537 |
What version of Go are you using (
go version
)?1.10
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?playground
What did you do?
https://play.golang.org/p/GwgbEnX3_7N
What did you expect to see?
missingFunction (see the link) should be among the return values of runtime.Caller(k) for some k but is not.
What did you see instead?
runtime.Caller returns ok=true but zero values for pc, filePath, and line for the value of k where missingFunction should be.
runtime.Callers does not have this problem.
output from runtime.Caller(k) for k=0..6:
output from runtime.Callers/CallersFrames:
This is a regression in 1.10; for 1.9.2, the program prints
The text was updated successfully, but these errors were encountered: