Skip to content

feat(diagnostics): native crash backtrace capture (RFC 0020 clause 7) - #69

Merged
willwade merged 1 commit into
mainfrom
feat/native-crash-capture
Sep 22, 2026
Merged

willwade merged 1 commit into
mainfrom
feat/native-crash-capture

Conversation

@willwade

Copy link
Copy Markdown
Contributor

Native crashes are invisible to PostHog (Kotlin uncaught handler sees nothing) — Heide's v0.1.21 emoji crash on Android 13 left no trace. This installs signal handlers at JNI_OnLoad (SIGSEGV/SIGBUS/SIGABRT/SIGFPE) that log an _Unwind_Backtrace symbolised via dladdr under the DasherNativeCrash logcat tag, then re-raise so tombstones still generate.

Not async-signal-safe perfection (dladdr in a handler) — a garbled backtrace beats none. Unblocks RFC 0020 clause 7: the next field-reported native crash becomes a readable stack.

PostHog's Kotlin uncaught-exception handler cannot see native crashes —
Heide's v0.1.21 emoji crash produced no error-tracking issue at all.
Install SIGSEGV/SIGBUS/SIGABRT/SIGFPE handlers at JNI_OnLoad that log an
_Unwind_Backtrace (symbolised via dladdr) under the DasherNativeCrash
tag, then restore defaults and re-raise so the platform tombstone flow
still records the crash. Next field-reported native crash becomes a
readable stack in logcat.

Signed-off-by: will wade <willwade@gmail.com>
@willwade
willwade merged commit a7efe43 into main Sep 22, 2026
2 checks passed
@willwade
willwade deleted the feat/native-crash-capture branch September 22, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant