Skip to content

Document AndroidOptions.SuppressSegfaults #3943

Closed
getsentry/sentry-docs
#18623

Description

@jamescrosswell

Activity

  1. self-assigned this
    on Feb 21, 2025
  2. moved this to Done in GDXon Feb 21, 2025
  3. added
    .NETPull requests that update .net code
    on Mar 24, 2026
  4. jamescrosswell commented on Jul 2, 2026

    @jamescrosswell
    CollaboratorAuthor

    Picking this up as a documentation task. Some context on how the landscape has shifted since this issue was filed, since SuppressSegfaults is no longer the only (or preferred) answer here.

    The underlying problem — a single managed exception that surfaces as a native signal (e.g. a NullReferenceException raised as a SIGSEGV) gets captured twice: once as the managed .NET exception, once as a native crash. This is tracked in #3954.

    The newer, preferred fix (@jpnurmi) reorders the signal handlers so the .NET runtime handles the managed exception first, preventing the duplicate at the source rather than suppressing the native signal:

    So the platform story is now:

    • iOS — automatic since 6.4.0; there is no SuppressSegfaults option on iOS.
    • Android — SignalHandlerStrategy.ChainAtStart is the preferred (experimental) fix; AndroidOptions.SuppressSegfaults (Suppress Native SIGSEGV signal errors on Android #3903) remains as a blunt fallback that suppresses SIGSEGV capture entirely (and can therefore hide genuine native segfaults).

    Rather than documenting SuppressSegfaults in isolation, I've written this up as a "Duplicate events from native crashes" troubleshooting section that leads with the preferred fix per platform and keeps SuppressSegfaults as a documented Android fallback:

    getsentry/sentry-docs#18623

    Closing here once that merges. Flagging in case anyone thinks SuppressSegfaults should instead be deprecated now that ChainAtStart exists.

  5. jpnurmi commented on Jul 2, 2026

    @jpnurmi
    Collaborator

    Closing here once that merges. Flagging in case anyone thinks SuppressSegfaults should instead be deprecated now that ChainAtStart exists.

    +1 for leaving SuppressSegfaults available as an alternative option alongside ChainAtStart as long as they are needed. I guess we won't be able to get rid of them anytime soon because .NET 10 LTS surely will be supported for a good while, and dotnet/runtime#125835 won't be available until .NET 11 (v11.0.0-preview.5.26302.115). I wonder if we should try to request it to be cherry-picked into .NET 10... 🤔

  6. jamescrosswell commented on Jul 2, 2026

    @jamescrosswell
    CollaboratorAuthor

    Closing here once that merges. Flagging in case anyone thinks SuppressSegfaults should instead be deprecated now that ChainAtStart exists.

    +1 for leaving SuppressSegfaults available as an alternative option alongside ChainAtStart as long as they are needed. I guess we won't be able to get rid of them anytime soon because .NET 10 LTS surely will be supported for a good while, and dotnet/runtime#125835 won't be available until .NET 11 (v11.0.0-preview.5.26302.115). I wonder if we should try to request it to be cherry-picked into .NET 10... 🤔

    Did we get the docs wrong on this?

    • Not compatible with .NET runtimes 10.0.0–10.0.3 (.NET SDKs 10.0.100–10.0.103). On those versions, the SDK falls back to the default strategy automatically. This was fixed in .NET runtime 10.0.4 (.NET SDK 10.0.200).

    Is the android fix not available until .NET 11 at the moment?

  7. jpnurmi commented on Jul 3, 2026

    @jpnurmi
    Collaborator

    ChainAtStart docs look correct to me. Due to changes in .NET 10, ChainAtStart cannot be used with Mono in those few early .NET 10.0.0-10.0.3 versions. Other .NET versions are not impacted.

    There's another Mono fix coming in .NET 11, that supercedes the short-term ChainAtStart fix and allows us to reorder the signal handlers properly (io.sentry.ndk.preload=true).

  8. added a commit that references this issue on Jul 8, 2026
    bb93569
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions