Skip to content

Commit

Permalink
Fix backtraces on Wine (#460)
Browse files Browse the repository at this point in the history
Wine's implementation of `StackWalkEx` expects the `StackFrameSize`
field of `STACKFRAME_EX` to be properly initialized to the size of
`STACKFRAME_EX`.
  • Loading branch information
Amanieu authored Jan 28, 2022
1 parent f2705f8 commit 87be38e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backtrace/dbghelp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
// since it's in theory supported on more systems.
match (*dbghelp.dbghelp()).StackWalkEx() {
Some(StackWalkEx) => {
let mut inner: STACKFRAME_EX = mem::zeroed();
inner.StackFrameSize = mem::size_of::<STACKFRAME_EX>() as DWORD;
let mut frame = super::Frame {
inner: Frame {
stack_frame: StackFrame::New(mem::zeroed()),
stack_frame: StackFrame::New(inner),
base_address: 0 as _,
},
};
Expand Down

0 comments on commit 87be38e

Please sign in to comment.