Comments (5)
I think the easiest way to do this would be to try to move the __rust_begin_short_backtrace
and __rust_end_short_backtrace
symbols around. That way everything continues working as normal.
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.
from rust.
I think the easiest way to do this would be to try to move the
__rust_begin_short_backtrace
and__rust_end_short_backtrace
symbols around. That way everything continues working as normal.
i don't see how this helps? if you move it to expect_failed
, you now need a bunch of begin_short_backtrace
stubs, one for each possible approach to the panic machinery. i see 10 calls to panic_fmt alone, that doesn't seem maintainable.
the backtrace
crate gives us access to the module names, that seems much simpler than trying to hack it by inserting custom frames.
from rust.
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.
from rust.
For short backtraces, I would also like to propose trimming the pre-main frames too
from rust.
I think that's in the OP:
and the
core::ops::function::FnOnce::call_once
that show up at the end of the backtrace as well.
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 FnOnce::call_once
entry is straightforward in that the heuristic is just to omit the frame before we encounter __rust_begin_short_backtrace
. I don't see a straightforward way to make this happen because the backtrace printing needs to manage state in a way it doesn't right now. I don't see any fragility, we should just do this.
Omitting frames based on the core::panicking
path looks like a good heuristic based on the backtrace for assert_eq!
, but I'm wary of what would happen in a backtrace that exits the module then comes back to it. Perhaps we can also make this resilient this by adding yet more state to the backtrace printing? If we keep track of the fact that saw __rust_end_short_backtrace
then continue skipping frames until we get something that isn't rust_begin_unwind
or in core::panicking
... maybe that works well enough? At that point though I'd really like to see a refactor of the backtrace printing state machine. It's quite unwieldy already.
from rust.
Related Issues (20)
- ICE: You can't project to field 0 of `DynMetadata` because layout is weird and thinks it doesn't have fields. HOT 2
- ICE: trivial bounds : `Failed to normalize Alias(Projection` HOT 1
- Confusing rustdoc layout for `const` functions that are unstable even in non-`const` contexts HOT 2
- ICE: `cycle detected when computing function signature of`
- ICE: Opaque types got hidden types registered from within subtype predicate HOT 2
- Why don't slices use dedicated metadata structs? HOT 7
- ICE: `layout mismatch for result of MulWithOverflow` HOT 4
- ReentrantLockGuard's Sync impl is unsound HOT 2
- use osc 8 hyperlinks to link to the reference for lints when they are printed HOT 1
- frameworks not supported error HOT 6
- compiletest should note when test output is normalized HOT 1
- Uncredible virtual memory usage when compile, maybe memory leak HOT 1
- PhantomData confusing documentation
- Performance regression between v1.76.0 and v1.77.2 HOT 10
- Nightly rustc panic when compiling a simple no_std program HOT 2
- Wrong import hint HOT 1
- add a custom diagnostic for type mismatches of constants
- Compilation bug while using Diesel framework HOT 6
- ICE: `could not resolve upvar: LocalVarId(HirId(DefId)))`
- Compiler creates unnecessary pointer to the value on ownership transfering. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.