-
Notifications
You must be signed in to change notification settings - Fork 130
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
[PLAT-3596] Fix reporting of mach exception code and subcode #806
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kstenerud
requested changes
Sep 16, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure the unsigned ints are safe for other languages to ingest (in particular, with the 64th bit set).
Bugsnag/KSCrash/Source/KSCrash/Recording/Sentry/BSG_KSCrashSentry_MachException.c
Show resolved
Hide resolved
nickdowell
changed the title
[PLAT-3596] Incorporate KSCrash mach exception handling improvements
[PLAT-3596] Fix reporting of mach exception code and subcode
Sep 18, 2020
kattrali
reviewed
Sep 18, 2020
nickdowell
force-pushed
the
3596-fix-mach-exception-code-handling
branch
from
September 21, 2020 16:03
c563316
to
e725113
Compare
kattrali
approved these changes
Sep 22, 2020
kstenerud
approved these changes
Sep 22, 2020
This was referenced Oct 1, 2020
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
This change brings in some improvements to mach exception handling that were made in KSCrash
These changes fix the parsing of mach exception
code
andsubcode
values.Prior to these changes, for a
EXC_BAD_ACCESS
exception, thesubcode
did not contain the expected memory address. The exception handler was expecting the kernel to send 64-bit values, but 32-bit values were being sent instead because theMACH_EXCEPTION_CODES
flag was not specified when registering the exception handler. There was also a struct padding issue (fixed by adding#pragma pack(4)
) that was causing the exception handler to read values from the wrong offset, resulting in the memory address coming through ascode
andsubcode
to always contain the value0x8
.Testing
I verified manually, using the example app, that the
EXC_BAD_ACCESS
mach exception is reported to the dashboard. The dashboard is now correctly identifying and displaying the memory address that the app tried to access.