Skip to content

Allow configuring Windows minidump type via sentry_options_t API in C++ SDK #1335

Closed

Description

@0xC05StackOverflow

Problem Statement

The Sentry C++ SDK (sentry-native) currently generates minimal crash dumps on Windows using Crashpad. While this works for basic crash diagnostics, it lacks deeper memory-related information, such as heap state, handles, or full memory regions. In debugging complex issues (e.g., heap corruption, access violations, resource leaks), this limitation makes crash analysis significantly harder.

Although Crashpad internally supports various minidump levels via MINIDUMP_TYPE (e.g., MiniDumpWithFullMemory, MiniDumpWithHandleData), the current Sentry C++ API does not provide any mechanism to configure or override this behavior. As a result, users are forced to fork or wrap Crashpad themselves to generate richer dumps, which is error-prone and difficult to maintain.

Solution Brainstorm

Expose a new API in sentry_options_t to configure the desired Windows minidump level (e.g., via flags or an enum representing MINIDUMP_TYPE values). This option could be transparently passed to Crashpad at initialization time via command-line arguments or inter-process communication, similar to how other options are forwarded to the crashpad_handler.

Example proposal (pseudo-API):

void sentry_options_set_windows_minidump_type(sentry_options_t* opts, unsigned int minidump_type);
Where minidump_type is a bitmask compatible with Windows' MINIDUMP_TYPE enum.

This would allow users to enable richer dump types like:

MiniDumpWithFullMemory

MiniDumpWithHandleData

MiniDumpWithThreadInfo

...

without needing to fork or modify Crashpad directly.

Product Area

Settings

Activity

  1. getsantry commented on Aug 8, 2025

    @getsantry

    Assigning to @getsentry/support for routing ⏲️

  2. moved this to Waiting for: Support in GitHub Issues with 👀 3on Aug 8, 2025
  3. transferred this issue fromgetsentry/sentryon Aug 8, 2025
  4. moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3on Aug 8, 2025
  5. supervacuus commented on Aug 12, 2025

    @supervacuus
    Collaborator

    Sounds like a good idea. We recently had a similar conversation internally. The Win32 API exposes a way to configure MiniDump contents based on a particular type specification, and the sole reason they aren't exposed in the Native SDK is that we cannot provide this cross-platform. But that doesn't mean we can't expose a Windows-specific function that applies to breakpad and crashpad.

  6. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Aug 12, 2025
  7. added
    Improvement
    on Aug 12, 2025
  8. added
    Help Wanted
    on Aug 12, 2025
  9. 24 remaining items

  10. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 24, 2026
  11. jpnurmi commented on Jul 24, 2026

    @jpnurmi
    Collaborator

    For interaction with sentry_options_set_minidump_mode(), would you prefer explicit flags to retain precedence, or should the most recently called setter win?

    No strong opinion on that because I think either works, but to me it sounds less surprising if the most recently called setter wins.

    Alternatively, you could introduce CUSTOM minidump mode to make it explicit and avoid surprises.

  12. HuzaifaAbdulRehman commented on Jul 24, 2026

    @HuzaifaAbdulRehman
    Contributor

    Thanks @jpnurmi. I agree that the most recently called setter winning is the least surprising behavior.
    My preference would be to keep sentry_minidump_mode_t unchanged rather than expose a public CUSTOM value, since callers could otherwise select custom mode without providing flags. Internally, the Windows flags setter could activate the override, while a subsequent call to sentry_options_set_minidump_mode() would clear it and restore the selected preset.
    Does that approach sound preferable, or would you rather expose CUSTOM publicly?

  13. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 24, 2026
  14. jpnurmi commented on Jul 24, 2026

    @jpnurmi
    Collaborator

    Thanks @jpnurmi. I agree that the most recently called setter winning is the least surprising behavior. My preference would be to keep sentry_minidump_mode_t unchanged rather than expose a public CUSTOM value, since callers could otherwise select custom mode without providing flags. Internally, the Windows flags setter could activate the override, while a subsequent call to sentry_options_set_minidump_mode() would clear it and restore the selected preset. Does that approach sound preferable, or would you rather expose CUSTOM publicly?

    I get the feeling that no matter how we structure the API, there's always some way to misuse it. 🙂 Probably a matter of documenting that the two functions are mutually exclusive, and logging a warning when overriding the other because it could be an oversight.

  15. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 24, 2026
  16. HuzaifaAbdulRehman commented on Jul 24, 2026

    @HuzaifaAbdulRehman
    Contributor

    Understood, thanks @jpnurmi. I’ll proceed with the internal override and last-setter-wins behavior, document that the two setters are mutually exclusive, log a warning when either setter replaces an active setting from the other, and cover both calling orders in tests.

  17. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 24, 2026
  18. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 24, 2026
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

    ErrorsHelp WantedImprovementNativebackend: breakpadbackend: crashpad

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions