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 encoding of .eh_frame for small LSDA encoding #704

Merged
merged 2 commits into from
Mar 30, 2024

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Mar 28, 2024

No description provided.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Mar 28, 2024

Without this an LSDA encoded as DW_EH_PE_pcrel | DW_EH_PE_sdata4 would cause the .eh_frame section to be corrupt. I found this issue while implementing unwinding support for cg_clif.

@bjorn3 bjorn3 changed the title Fix encoding of .eh_frame when the LSDA is encoded using a pointer sm… Fix encoding of .eh_frame for small LSDA encoding Mar 28, 2024
Copy link
Collaborator

@philipc philipc left a comment

Choose a reason for hiding this comment

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

Thanks!

Can you add a test for this in test_frame_table (or change the test there to use DW_EH_PE_sdata4).

@bjorn3
Copy link
Contributor Author

bjorn3 commented Mar 30, 2024

Done and checked that the test catches this bug:

---- write::cfi::tests::test_frame_table stdout ----
thread 'write::cfi::tests::test_frame_table' panicked at src/write/cfi.rs:945:22:
called `Result::unwrap()` on an `Err` value: Read(UnexpectedEof(ReaderOffsetId(139971507795137)))

@philipc philipc merged commit 7294ff0 into gimli-rs:master Mar 30, 2024
20 checks passed
@bjorn3 bjorn3 deleted the fix-lsda-encoding branch March 30, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants