-
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: inlined function doesn't appear in stack trace #10152
Comments
It's because the function is inlined into main. If you call another function bar, then foo will no longer be inlineable in If you disable the inlining with -gcflags -l, then you will see the traceback We need more sophisticated pcln table to support traceback inlind |
I just ran into the same problem and spent quite some time finding out that my function was inlined and the dereference causing the panic was actually somewhere else in my code. |
I just got bit by this once more. What needs to happen for this to be included in the next possible release? |
We need to figure out how to do it, then implement it. |
(Some discussion is in #11432) |
Got out of range panic in test on:
while it actually happened somewhere over there:
Now that #11432 is fixed and the "how" part is resolved, can this be reconsidered? |
We may have do some work on the inliner in the winter. /cc @aclements |
CL https://golang.org/cl/37233 mentions this issue. |
Let's say I have a struct like the one below.
Sometimes I forget to check if a field is nil. If I do a return statement that ends up dereferencing a nil pointer, like http://play.golang.org/p/WzyNpsiBam, I would expect the stack trace from the panic to be on the same line as the return statement. Instead, the stack trace indicates that the nil pointer dereference happened on the same line as the caller.
Interestingly, the same thing happens if I assign to a variable first.
http://play.golang.org/p/M3q3cSLgBk
If I enter another function before returning the variable, the stack trace is correct.
http://play.golang.org/p/eOZc34Uya7
The text was updated successfully, but these errors were encountered: