-
Notifications
You must be signed in to change notification settings - Fork 13k
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
hide panic internals in short backtraces #124586
Comments
I think the easiest way to do this would be to try to move the It should be fine if this accidentally results in some duplication in the full trace. The filtering must already be resilient against the fact that we are neither guaranteed that these symbols only appear once, or at all. |
i don't see how this helps? if you move it to the |
Hmm. Making the backtrace filtering logic more fragile does not seem automatically "simpler" to me, since now it has to handle a number of other conditions and it has to be aware that it can only exclude these frames at the beginning of the (shortened) backtrace, not if they somehow appear elsewhere, but I would be willing to review such a PR. |
For short backtraces, I would also like to propose trimming the pre-main frames too |
I think that's in the OP:
I've been thinking about how to do this. I agree with Jubilee's concern that just going off module path is fragile, but I'm not totally sure that alternative approaches are worth the complexity. Omitting the Omitting frames based on the |
here's a draft of how the backtraces look using debuginfo as described in rust-lang/compiler-team#818: https://github.com/jyn514/rust/blob/backtrace-debuginfo/tests/ui/backtrace/std-backtrace-skip-frames.full.run.stderr |
right now, nearly all
foo.expect("bar")
backtraces start like this:this is not super useful. it doesn't add any information, other than maybe the very last frame which says you called
expect()
. it would be nice to omit anything in thecore::panicking
module from the backtrace; and maybeexpect_failed
and thecore::ops::function::FnOnce::call_once
that show up at the end of the backtrace as well. people can always opt back in with RUST_BACKTRACE=full.the code for this lives in
rust/library/std/src/sys_common/backtrace.rs
Lines 77 to 81 in 378a43a
@rustbot label +T-libs +A-runtime
The text was updated successfully, but these errors were encountered: