-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: arm64 bt in Delve get endless main.main after nil pointer dereference #63862
Comments
/cc @golang/compiler |
There is already a Delve issue opened regarding this: go-delve/delve#3545. Haven't determined quite yet where the issue lies, so feel free to close this until we can definitively point to an upstream root cause. |
@derekparker thanks for that -- will close this out for now. |
Sorry for the whiplash, but I believe this may actually be a compiler bug. The following is the AMD64 (which is working):
ARM64 (broken):
Notice in the ARM64 version we have If the program is modified such that
Which now shows how we find the return address at |
To add onto the above, I'm not really sure what the compiler should generate in such a case. We could work around this in Delve, most likely, by special casing based on seeing |
@derekparker Thanks for the investigation. Interesting. I agree that this is a tricky case, because the frame is not usually there, unless it panics and sigpanic injects a frame. In the runtime's unwinder we special case sigpanic https://cs.opensource.google/go/go/+/master:src/runtime/traceback.go;l=498-510 . If you have any suggestion for DWARF unwind info we should generate, that would be great. Otherwise I feel the best option is probably to have Delve do similar special case, if that is not too complex. Thanks. |
@thanm (or anybody) do you know what C/C++ compiler do for frameless leaf functions when -fnon-call-exceptions is enabled? What unwind information does it generate? |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?CentOS Linux release 7.9.2009 (AltArch)
go env
OutputWhat did you do?
What did you expect to see?
After nil pointer dereference, bt can get the righe stack.
What did you see instead?
After nil pointer dereference, stack is endless main.main
Before nil pointer dereference happens, we get the SP, named SP_value_1 = 0x0000004000160770.
After nil pointer dereference happens, we get the SP again on the same frame, named SP_value_2 = 0x0000004000160760.
Two SP value for same function is different. This may be the cause of coredump endless main.main.
This problem does not reproduce using x86.
The text was updated successfully, but these errors were encountered: