feat(samples): Make Native Crash button fault inside app native code#5773
Merged
Conversation
runningcode
requested review from
0xadam-brown,
adinauer,
markushi and
romtsn
as code owners
July 16, 2026 13:48
Contributor
|
📲 Install BuildsAndroid
|
The Native Crash button called raise(SIGSEGV), which faults inside libc and, for a JNI-originated crash, does not exercise symbolication of the app's own native code. Point it at a null-deref inside a named function (trigger_null_deref) instead, so the crashing frame resolves to a real symbol + source line and native symbolication can be verified from the sample. Ref JAVA-645 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01EmE8hdaj9H9K61opK2PZ6U
runningcode
force-pushed
the
no/native-sample-segfault-crash
branch
from
July 16, 2026 13:52
5703b7b to
001d5b8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 001d5b8. Configure here.
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b193867 | 319.59 ms | 403.09 ms | 83.50 ms |
| 2124a46 | 319.19 ms | 415.04 ms | 95.85 ms |
| a5ab36f | 316.83 ms | 394.54 ms | 77.71 ms |
| dba088c | 320.59 ms | 361.29 ms | 40.70 ms |
| 4e3e79d | 328.10 ms | 395.64 ms | 67.54 ms |
| abfcc92 | 309.54 ms | 380.32 ms | 70.78 ms |
| 539ca63 | 313.51 ms | 355.43 ms | 41.92 ms |
| 3d205d0 | 352.15 ms | 432.53 ms | 80.38 ms |
| bb0ff41 | 312.86 ms | 363.78 ms | 50.92 ms |
| 2195398 | 319.02 ms | 342.38 ms | 23.36 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b193867 | 1.58 MiB | 2.19 MiB | 620.00 KiB |
| 2124a46 | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| a5ab36f | 1.58 MiB | 2.12 MiB | 555.26 KiB |
| dba088c | 1.58 MiB | 2.13 MiB | 558.99 KiB |
| 4e3e79d | 0 B | 0 B | 0 B |
| abfcc92 | 1.58 MiB | 2.13 MiB | 557.31 KiB |
| 539ca63 | 1.58 MiB | 2.12 MiB | 551.41 KiB |
| 3d205d0 | 1.58 MiB | 2.10 MiB | 532.97 KiB |
| bb0ff41 | 0 B | 0 B | 0 B |
| 2195398 | 0 B | 0 B | 0 B |
romtsn
approved these changes
Jul 17, 2026
runningcode
enabled auto-merge (squash)
July 17, 2026 10:45
runningcode
disabled auto-merge
July 17, 2026 10:45
markushi
self-requested a review
July 17, 2026 14:09
markushi
approved these changes
Jul 17, 2026
Contributor
Author
|
Thanks for checking this! |
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.

📜 Description
Changes the Android sample's Native Crash button so it faults inside app native code — a null-pointer dereference in a named function (
trigger_null_derefinnative-sample.cpp) — instead ofraise(SIGSEGV).💡 Motivation and Context
raise(SIGSEGV)faults insidelibc, and for a crash originated from a JNI call the unwind is either the managed ART/OAT stack or a degenerate native stack — so it does not exercise symbolication of the app's own native code. A genuine null-deref inside a named function faults with a valid PC insidelibnative-sample.so, so the crashing frame resolves to a real symbol + source line. This makes it easy to verify native symbol upload / symbolication end-to-end from the sample.Came out of the JAVA-645 investigation, where
raise(SIGSEGV)turned out to be a poor vehicle for testing native symbolication.💚 How did you test it?
During the JAVA-645 investigation, an equivalent null-deref (
crash()→trigger_null_deref()) was run on a Pixel 10 (Android 17), release build with SAGP (uploadNativeSymbols=true), and the crashing frame symbolicated totrigger_null_derefinnative-sample.cppwith the source line shown.This exact change compiles (
assembleRelease); I did not re-flash it, so the reported line reflects the committed layout —*ptr = 42;isnative-sample.cpp:15.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None — sample-only change.
#skip-changelog