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

32-bit exception information is sometimes sign-extended causing confusion when decoding Windows error codes #893

Open
gabrielesvelto opened this issue Nov 13, 2023 · 0 comments

Comments

@gabrielesvelto
Copy link
Collaborator

I've noticed that some Windows crashes for 32-bit Firefox & Thunderbird builds where showing odd values for the crash reason, for example this one. The crash reason is EXCEPTION_IN_PAGE_ERROR_READ / 0xffffffffc0000006 which is clearly wrong. Sifting through more crashes I figured out that it seems that windbg.dll is sign-extending Windows status codes when writing them to the minidump's exception stream exception_information array (which is made up of 64-bit values). To address this issue we'll have to either clear or ignore the upper bits of the elements pulled out of the exception_information array. I'd like the fix to be as small as possible as I don't want to accidentally throw away meaningful data just because of an implementation bug in some closed-source library.

gabrielesvelto added a commit to gabrielesvelto/rust-minidump that referenced this issue Nov 13, 2023
When interpreting Windows status code that have been stored as 64-bit
values, ignore the upper 32 bits as they're likely to contain bogus
data. In particular windbg.dll seems to sign-extend the 32-bit value
when storing it as a 64-bit one.

Note that we're not really throwing away data with this patch as the
status codes are supposed to be 32 bits, so we shouldn't have relied on
the upper 32 bits being cleared in the first place.

This fixes issue rust-minidump#893
gabrielesvelto added a commit to gabrielesvelto/rust-minidump that referenced this issue Nov 24, 2023
When interpreting Windows status code that have been stored as 64-bit
values, ignore the upper 32 bits as they're likely to contain bogus
data. In particular windbg.dll seems to sign-extend the 32-bit value
when storing it as a 64-bit one.

Note that we're not really throwing away data with this patch as the
status codes are supposed to be 32 bits, so we shouldn't have relied on
the upper 32 bits being cleared in the first place.

This fixes issue rust-minidump#893
gabrielesvelto added a commit that referenced this issue Nov 24, 2023
…d. (#894)

When interpreting Windows status code that have been stored as 64-bit
values, ignore the upper 32 bits as they're likely to contain bogus
data. In particular windbg.dll seems to sign-extend the 32-bit value
when storing it as a 64-bit one.

Note that we're not really throwing away data with this patch as the
status codes are supposed to be 32 bits, so we shouldn't have relied on
the upper 32 bits being cleared in the first place.

This fixes issue #893
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

No branches or pull requests

1 participant