Skip to content

fix: Mark mach and signal crashes as synthetic - #8919

Merged
bitsandfoxes merged 5 commits into
mainfrom
fix/set-synthetic
Sep 7, 2026
Merged

bitsandfoxes merged 5 commits into
mainfrom
fix/set-synthetic

Conversation

@bitsandfoxes

@bitsandfoxes bitsandfoxes commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Relates to and enables getsentry/sentry#122130
This allows Sentry to properly group events coming from hybrid SDKs (same error, multiple platforms reporting it) as one issue.

image

💡 Motivation and Context

See dev docs on Synthetic Errors

Synthetic errors are errors that carry little meaning by themselves — they are often created at a central place (like a crash handler) and share the same title (Error, Segfault, etc.). When synthetic is set, Sentry will try to use other information (top in-app frame function) rather than the exception type and value for the primary event display. Sentry will also ignore the exception type when grouping.

The synthetic flag SHOULD be set for all "segfaults" and similar low-information errors.

When the flag is set, Sentry ignores the exception type when grouping, and prefers the top in-app frame over type/value for the issue title.

The same crash in the same shared code, as reported by each SDK today:

sentry.native          type='SIGSEGV'  synthetic=True   mech='signalhandler'
sentry.native.android  type='SIGSEGV'  synthetic=True   mech='signalhandler'
sentry.cocoa           type='SIGSEGV'  synthetic=nil    mech='signal'      <- the holdout

sentry-cocoa is the only SDK leaving the flag unset, so SIGSEGV stays in the grouping hash on Apple platforms and nowhere else. Cocoa events split into their own issue even when every other grouping input is byte-identical. For a Unity or React Native team shipping one codebase to five platforms, that means one bug shows up as "everything else" plus a separate Apple issue.

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper.

Closes #8920

@bitsandfoxes bitsandfoxes changed the title fix: Mark mach and signal crashes as synthetic fix: Mark mach and signal crashes as synthetic Sep 2, 2026
@bitsandfoxes
bitsandfoxes marked this pull request as ready for review September 2, 2026 14:26
@itaybre itaybre added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Sep 2, 2026

@itaybre itaybre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and worked on my local tests, but looksl ike you need to update the changelog message (probably you should wait for 9.27.0 release tomorrow)

@sentry

sentry Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.27.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1215.14 ms 1267.32 ms 52.18 ms
Size 24.14 KiB 1.32 MiB 1.29 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
df67624 1225.12 ms 1259.90 ms 34.78 ms
6e35062 1232.19 ms 1262.91 ms 30.73 ms
220d7ef 1238.77 ms 1267.42 ms 28.65 ms
4b5a1d7 1235.27 ms 1264.49 ms 29.22 ms
9319185 1223.24 ms 1249.98 ms 26.73 ms
d0b52d1 1227.31 ms 1258.32 ms 31.01 ms
b6b0d1d 1236.69 ms 1270.22 ms 33.52 ms
5b1c31e 1221.35 ms 1246.14 ms 24.79 ms
9787f05 1233.67 ms 1269.00 ms 35.33 ms
29d1b7f 1220.58 ms 1254.14 ms 33.56 ms

App size

Revision Plain With Sentry Diff
df67624 24.14 KiB 1.14 MiB 1.12 MiB
6e35062 24.14 KiB 1.22 MiB 1.20 MiB
220d7ef 24.14 KiB 1.17 MiB 1.14 MiB
4b5a1d7 24.14 KiB 1.22 MiB 1.20 MiB
9319185 24.14 KiB 1.16 MiB 1.13 MiB
d0b52d1 24.14 KiB 1.15 MiB 1.13 MiB
b6b0d1d 24.14 KiB 1.18 MiB 1.16 MiB
5b1c31e 24.14 KiB 1.24 MiB 1.22 MiB
9787f05 24.14 KiB 1.18 MiB 1.15 MiB
29d1b7f 24.14 KiB 1.26 MiB 1.23 MiB

Previous results on branch: fix/set-synthetic

Startup times

Revision Plain With Sentry Diff
50ccd4e 1221.98 ms 1261.35 ms 39.37 ms
1840901 1216.08 ms 1259.79 ms 43.70 ms

App size

Revision Plain With Sentry Diff
50ccd4e 24.14 KiB 1.31 MiB 1.29 MiB
1840901 24.14 KiB 1.32 MiB 1.29 MiB

Comment thread CHANGELOG.md Resolved
@bitsandfoxes
bitsandfoxes merged commit b45b76b into main Sep 7, 2026
251 of 252 checks passed
@bitsandfoxes
bitsandfoxes deleted the fix/set-synthetic branch September 7, 2026 11:19
philprime pushed a commit that referenced this pull request Sep 11, 2026
Reland of #8919, reverted in #8975 because the server-side fix
that keeps the exception type as a title fallback had not landed.

The fabricated mach and signal exceptions carry a platform label
as their type, not the identity of what went wrong, so it must not
split an Apple crash from the same crash on other platforms.

Also sets mechanism.handled outside the mach-context branch, which
previously left it unset on a report without mach context.

Claude-Session: https://claude.ai/code/session_01E57gchi6ER5aruqwjCKe9F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Mark mach and signal crashes as synthetic

4 participants