Skip to content

Commit

Permalink
fix(cfi): Skip u64::MAX FDEs when converting DWARF
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim committed Sep 17, 2024
1 parent 63daf8f commit 3fed0cb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions symbolic-cfi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,15 @@ impl<W: Write> AsciiCfiWriter<W> {
R: Reader + Eq,
U: UnwindSection<R>,
{
// We have seen FDEs with an initial address of `u64::MAX` in user-provided
// DWARF files. Such FDEs will invariably fail to process because of either
// an address overflow error in `gimli` or an underflow in the `length`
// calculation below. Therefore, we skip them immediately so we don't abort
// the processing of the entire file.
if fde.initial_address() == u64::MAX {
return Ok(());
}

// Retrieves the register that specifies the return address. We need to assign a special
// format to this register for Breakpad.
let ra = fde.cie().return_address_register();
Expand Down

0 comments on commit 3fed0cb

Please sign in to comment.