Skip to content

Commit

Permalink
Avoid a deadlock when registering FDEs at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
koute committed Jun 10, 2021
1 parent c103773 commit eb4097e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions preload/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@ pub unsafe extern "C" fn __register_frame( fde: *const u8 ) {
error!( "__register_frame call ignored since we couldn't find the original symbol" );
}

let thread = StrongThreadHandle::acquire();
unwind::register_frame_by_pointer( fde );
std::mem::drop( thread );
}

#[cfg_attr(not(test), no_mangle)]
Expand All @@ -572,5 +574,7 @@ pub unsafe extern "C" fn __deregister_frame( fde: *const u8 ) {
error!( "__deregister_frame call ignored since we couldn't find the original symbol" );
}

let thread = StrongThreadHandle::acquire();
unwind::deregister_frame_by_pointer( fde );
std::mem::drop( thread );
}

0 comments on commit eb4097e

Please sign in to comment.