8000 Modify the macOS minidump exception stream writer to match Crashpad · Issue #33 · rust-minidump/minidump-writer · GitHub
[go: up one dir, main page]

Skip to content

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

Closed

Description

@gabrielesvelto

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0