Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cfi): Skip u64::MAX FDEs when converting DWARF #868

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

**Fixes**
- symbolic-cfi: Skip invalid FDEs when converting DWARF to Breakpad CFI ([#868](https://github.com/getsentry/symbolic/pull/868))

**Internal**:

- Removed `dmsort` dependency and replaced uses with stable std sorts. ([#869](https://github.com/getsentry/symbolic/pull/869))
Expand Down
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(());
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I can't see how—our only example is a debug file from Riot, and we can't put that on GH.

// 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
Loading