Skip to content

Commit

Permalink
Reliably construct backtraces when stack switching is enabled.
Browse files Browse the repository at this point in the history
This patch is a follow up on PR bytecodealliance#35. It partially addresses issue
presence of stack switching as older frame pointers are not guaranteed
to be greater than the current frame pointer (e.g. tracing across
stack boundaries).
  • Loading branch information
dhil committed Nov 3, 2023
1 parent 6ec7875 commit 29900e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/runtime/src/traphandlers/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ impl Backtrace {

// Because the stack always grows down, the older FP must be greater
// than the current FP.
assert!(next_older_fp > fp, "{next_older_fp:#x} > {fp:#x}");
// TODO(dhil): The following assertion is not always true
// in the presence of stack switching.
//assert!(next_older_fp > fp, "{next_older_fp:#x} > {fp:#x}");
fp = next_older_fp;
}
}
Expand Down

0 comments on commit 29900e5

Please sign in to comment.