Skip to content

Commit

Permalink
Capture unresolved backtraces on traps (#4193)
Browse files Browse the repository at this point in the history
I was running tests recently and was surprised that the `--test all`
test was taking more than a minute to run when I didn't recall it ever
taking more than a minute historically. A bisection pointed out #4183 as
the cause and after re-reviewing I realized I forgot that we capture
unresolved backtraces by default (and don't actually resolve them
anywhere yet but that's a problem for another day) rather than resolved
backtraces. This means that it's intended that we use
`Backtrace::new_unresolved` instead of `Backtrace::new` in the
traphandlers crate.

The reason that tests were running so slowly is that the tests which
deal with deep stacks (e.g. stack overflow) would take forever in
testing as the Rust-based decoding of DWARF information is egregiously
slow in unoptimized mode. I did discover independently that optimizing
these dependencies makes the tests ~6x faster, but that's irrelevant if
we're not symbolicating in the first place.
  • Loading branch information
alexcrichton authored May 31, 2022
1 parent bffce37 commit 7d36395
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/runtime/src/traphandlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl CallThreadState {

fn unwind_with(&self, reason: UnwindReason) -> ! {
let backtrace = if self.capture_backtrace {
Some(Backtrace::new())
Some(Backtrace::new_unresolved())
} else {
None
};
Expand Down Expand Up @@ -340,7 +340,7 @@ impl CallThreadState {

fn capture_backtrace(&self, pc: *const u8) {
let backtrace = if self.capture_backtrace {
Some(Backtrace::new())
Some(Backtrace::new_unresolved())
} else {
None
};
Expand Down

0 comments on commit 7d36395

Please sign in to comment.