Skip to content

fix(android): native crash stacktraces in React Native apps - #2357

Open
jpnurmi wants to merge 1 commit into
v1from
jpnurmi/fix/native-android-stacktrace
Open

jpnurmi wants to merge 1 commit into
v1from
jpnurmi/fix/native-android-stacktrace

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Required for:

The signal handler's frame-pointer capture (#2174) stops at frames without records, such as ART's, so a JNI crash in a React Native app showed only the JNI function and an unknown address. The daemon now unwinds the crashed thread with libunwindstack (#1725) instead, unless on_crash or before_send replaced the stacktrace or the unwind fails.

Before After
image image

@jpnurmi
jpnurmi force-pushed the jpnurmi/fix/native-android-stacktrace branch from c90edf8 to 9559965 Compare November 30, 2026 14:57
@jpnurmi
jpnurmi changed the base branch from v1 to jpnurmi/fix/android-os-context November 30, 2026 14:57
@jpnurmi
jpnurmi added this pull request to stack #2358 November 30, 2026 14:58
@jpnurmi jpnurmi changed the title fix(android): truncated stacktraces in crash daemon events fix(android): natice crash stacktraces in React Native apps Dec 1, 2026
Base automatically changed from jpnurmi/fix/android-os-context to v1 December 1, 2026 11:34
@jpnurmi
jpnurmi force-pushed the jpnurmi/fix/native-android-stacktrace branch 3 times, most recently from 3b07568 to 1d60a99 Compare December 1, 2026 12:27
The signal handler records a frame-pointer walk of the crashed thread
because libunwindstack allocates. The walk stops at frames without
records, such as ART's, so a JNI crash in a React Native app kept only
the JNI function and an unknown address.

Replace the walk with a libunwindstack unwind of the saved fault
context unless `on_crash` or `before_send` replaced the stacktrace,
which the daemon detects by comparing frame addresses with the walk.
`on_crash` still sees the walk. Fall back to the walk if the unwind
fails.
@jpnurmi
jpnurmi force-pushed the jpnurmi/fix/native-android-stacktrace branch from 1d60a99 to 833fcae Compare December 1, 2026 16:04
@jpnurmi jpnurmi changed the title fix(android): natice crash stacktraces in React Native apps fix(android): native crash stacktraces in React Native apps Dec 1, 2026

This branch has not been deployed

No deployments
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