Skip to content
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: fix wrapper elision when mid-stack inlining #28640

Closed
randall77 opened this issue Nov 7, 2018 · 2 comments

Comments

@randall77
Copy link
Contributor

commented Nov 7, 2018

When we print a stack trace we skip wrapper functions, as they aren't user code so they might confuse users.
We currently make the decision on whether to print a stack frame or not, based on some information about the real frame that's on the stack.
However, once mid-stack inlining is enabled, a single real frame on the stack might represent multiple logical user frames. Some of those might be wrappers, some not.

The current behavior is that if the outermost frame is a wrapper, all the user frames inlined into it are not printed (unless the wrapper function is the first in the stack trace, which is a special case).
If the outermost frame is not a wrapper, all wrapper frames inlined into it are printed.

We really need to base the print/noprint decision on logical frames, not real frames.

CL 147361 has a band-aid fix for a test that fails because of this issue.
When this issue is fixed, remove that band-aid.

@gopherbot

This comment has been minimized.

Copy link

commented Dec 5, 2018

Change https://golang.org/cl/152537 mentions this issue: cmd/compile,runtime: redo mid-stack inlining tracebacks

@gopherbot

This comment has been minimized.

Copy link

commented Dec 10, 2018

Change https://golang.org/cl/153477 mentions this issue: runtime: proper panic tracebacks with mid-stack inlining

@gopherbot gopherbot closed this in 69c2c56 Dec 28, 2018

gopherbot pushed a commit that referenced this issue Jan 4, 2019

runtime: proper panic tracebacks with mid-stack inlining
As a followon to CL 152537, modify the panic-printing traceback
to also handle mid-stack inlining correctly.

Also declare -fm functions (aka method functions) as wrappers, so that
they get elided during traceback. This fixes part 2 of #26839.

Fixes #28640
Fixes #24488
Update #26839

Change-Id: I1c535a9b87a9a1ea699621be1e6526877b696c21
Reviewed-on: https://go-review.googlesource.com/c/153477
Reviewed-by: David Chase <drchase@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.