fix(nswitch): Mark crashes synthetic so titles fall back to the crashing function - #6253
Open
mujacica wants to merge 7 commits into
Open
fix(nswitch): Mark crashes synthetic so titles fall back to the crashing function#6253mujacica wants to merge 7 commits into
mujacica wants to merge 7 commits into
Conversation
The native crash helpers are only compiled with the processing feature (pub use self::native::* is cfg-gated), so calling reshape_switch_crash unconditionally broke the default-features build (E0425). Wrap the call in if_processing! like the minidump path, and guard the now-conditional mut binding.
…cking Item::attachment_type can return NintendoSwitchDyingMessage from an explicitly set item header, bypassing the starts_with(magic) guard used when inferring the type. expand_dying_message then called Bytes::advance past the payload length, which panics and crashes the processing worker (DoS). Validate the magic up front and return an error instead. Reported by Warden wrdn-dos-review.
Comment on lines
+522
to
+526
| let envelope = r#"{"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","dsn":"https://e12d836b15bb49d7bbf99e64295d995b:@sentry.io/42"} | ||
| {"type":"event"} | ||
| {"level":"error","exception":{"values":[{"type":"2168-0002 ResultAccessViolationData","value":"Data access to an invalid memory region was performed. (2: Access Violation Data)","stacktrace":{"frames":[{"function":"ASentryTowerTurret::Shoot"}]}}]}} | ||
| {"type":"attachment","filename":"dying_message.dat","length":<len>} | ||
| "# |
Member
There was a problem hiding this comment.
Q: we have this "fake" json envelope constructed here, but we could add a test with an actual captured one from our switch-SDK integration tests. Not sure if this is somehow not advised?
A raw capture of what CRPortal actually delivers (via an Import Destination pointed at a local Relay) showed the forwarded event already carries mechanism.handled: false and level: fatal. The error level seen on stored events comes from the DyingMessage scope patch winning the merge, not from Nintendo. Remove the redundant handled write and correct the reshape docs, test premise, and changelog accordingly: synthetic remains the title fix, and the level write re-asserts the severity the merge downgraded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JoshuaMoelans
marked this pull request as ready for review
August 14, 2026 14:44
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switch crash events are titled with Nintendo's raw abort result code (e.g.
2168-0002 ResultAccessViolationData), hiding the crashing function and burying real regressions in a sea of identical-looking titles (getsentry/sentry-switch#153).This PR marks the exception
synthetic, the same treatment minidumps get viawrite_native_placeholder, so Sentry falls back to the symbolicated crashing function for the title. The result code stays queryable onexception.typeand themechanismtag. It also re-assertslevel: fatal— Nintendo forwards crashes as fatal, but the DyingMessage scope patch is the merge base and downgrades it toerror— and hardens dying-message parsing against a panic on payloads shorter than the magic number.Validated end-to-end against a real CRPortal-forwarded crash (captured by pointing a CRPortal Import Destination at a local Relay in processing mode): before → title
2168-0002 ResultAccessViolationData: …, after → titlennMain, level fatal. Details on the original issue.Event before fix:
https://sentry-sdks.sentry.io/issues/7671819961/?project=4509910938550273&query=is%3Aunresolved&referrer=issue-stream&sort=recommended
Event after fix:
https://sentry-sdks.sentry.io/issues/7671893807/?project=4509910938550273&query=is%3Aunresolved&referrer=issue-stream&sort=recommended