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

Modify the macOS minidump exception stream writer to match Crashpad #33

Closed
gabrielesvelto opened this issue May 25, 2022 · 0 comments · Fixed by #50
Closed

Modify the macOS minidump exception stream writer to match Crashpad #33

gabrielesvelto opened this issue May 25, 2022 · 0 comments · Fixed by #50

Comments

@gabrielesvelto
Copy link
Contributor

This entails several changes to capture the macOS-specific information in a way that's compatible with Crashpad. Note that rust-minidump expects this information to be stored according to what Crashpad does (and specifically how the exception code and subcode are stored) to format EXC_RESOURCE and EXC_GUARD exceptions.

Specifically:

  • MDException.exception_code should be set to the Mach exception kind (we already do that)
  • MDException.exception_flags should contain the low 32-bits of the Mach exception code save for EXC_RESOURCE and EXC_GUARD exceptions for which it must contain the upper 32-bits of the Mach exception code
  • MDException.exception_address should contain the Mach exception subcode for EXC_BAD_ACCESS instruction (which corresponds to the address of the access which faulted) and the IP of the instruction that threw the exception for all others or zero in case the subcode is not available (we're close but we need to explicitly check the type of exception)
  • MDException.number_parameters should be set to 2 if the subcode is 0, 3 otherwise
  • MDException.exception_information[0] should contain the Mach exception type
  • MDException.exception_information[1] should contain the Mach exception code
  • MDException.exception_information[2] should contain the non-zero Mach exception subcode

See here for the implementation in Firefox' forked Breakpad writer.

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 a pull request may close this issue.

1 participant