René's URL Explorer Experiment


Title: fix: restore native tombstones and record runtime crash breadcrumbs by edusperoni · Pull Request #2007 · NativeScript/android · GitHub

Open Graph Title: fix: restore native tombstones and record runtime crash breadcrumbs by edusperoni · Pull Request #2007 · NativeScript/android

X Title: fix: restore native tombstones and record runtime crash breadcrumbs by edusperoni · Pull Request #2007 · NativeScript/android

Description: Problem SIG_handler was installed for SIGABRT and SIGSEGV and threw a NativeScriptException from inside the signal handler. That is undefined behaviour: the unwinder cannot cross the kernel-built signal frame, so on arm64 the throw reached std::terminate → LogAndAbortUncaught → _Exit(EXIT_FAILURE) and the process died anyway. Installing sa_handler for SIGSEGV also displaced debuggerd, so no tombstone was written — no backtrace, no registers, no fault address. A crash produced exactly this, and nothing else: TNS.Native: Uncaught NativeScriptException: Exception Message: JNI Exception occurred (SIGSEGV). TNS.Native: ======= TNS.Native: Check the 'adb logcat' for additional information about the error. TNS.Native: ======= So the handler bought nothing: it destroyed the diagnostics and still crashed. This is why a genuine worker data race read as flaky tests for weeks (#2006). What changed A diagnostic-only handler that never throws. It writes a pre-rendered breadcrumb with a single write(2) and hands the signal back to whoever owned it before, so debuggerd still writes the tombstone with the kernel's original siginfo. State is rendered into a plain byte buffer on ordinary threads whenever it changes, double-buffered so the handler never reads a half-written one. The handler does two pwrite(2)s to a pre-opened fd and chains — no allocation, no lock, no JNI, no V8, no logging. Installed SA_SIGINFO | SA_ONSTACK. No alt stack is allocated: bionic already gives every thread one, and SA_ONSTACK is what makes a stack-overflow SIGSEGV survivable. Chaining restores the previous disposition and returns, letting the faulting instruction re-fault so debuggerd sees the kernel's original siginfo rather than a synthesized one. Signals with si_code <= 0 (abort/kill) cannot re-fault and are re-raised instead. std::set_terminate(LogAndAbortUncaught) is unchanged — that one is the legitimate handler for genuine uncaught C++ exceptions and already _Exit()s. Cost: a mutex + snprintf over ≤16 slots per runtime create/destroy, worker start, and module load. Module load already does file I/O and compilation, so this sits far below its noise floor. ~31 KB of static buffers and one fd. Nothing on any hot path; zero steady-state cost. Design decision: not android_set_abort_message android_set_abort_message was the obvious candidate and was tested first. It does reach SIGSEGV tombstones, not just SIGABRT (confirmed on API 35) — but bionic is first-write-wins: a probe set three messages and the tombstone showed the first. That rules it out. A breadcrumb has to update as the runtime moves, and a write-once slot freezes at startup state. Worse, claiming that slot means libc's fortify/assert messages and ART's Java-crash messages can no longer be recorded — we would be destroying diagnostics to add our own. That same finding caught a bug in the first cut of this change: the breadcrumb was reported with ANDROID_LOG_FATAL, and liblog feeds fatal records to android_set_abort_message, so it silently squatted the slot and surfaced as the Abort message: of the next process's tombstone. It now logs at ERROR, with the constraint documented in the code. Before / after Before: the four logcat lines above, no tombstone. (Known prior behaviour on main, reported from a real crash — not a measurement re-taken for this PR.) After, induced SIGSEGV on a worker thread — full tombstone, correct fault address, symbolized backtrace: pid: 15027, tid: 15180, name: W54: ./eventLoo >>> com.tns.testapplication <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000 Cause: null pointer dereference backtrace: #00 ... libNativeScript.so (tns::ModuleInternal::LoadModule(...)+372) #01 ... libNativeScript.so (tns::ModuleInternal::LoadImpl(...)+2404) #02 ... libNativeScript.so (tns::ModuleInternal::RequireCallbackImpl(...)+4900) #03 ... libNativeScript.so (tns::ModuleInternal::RequireCallback(...)+456) #04 ... libNativeScript.so (Builtins_CallApiCallbackGeneric+104) plus the breadcrumb, reported on next launch: fatal signal 11 on tid 15180 NativeScript runtime state (pid 15027): runtime=0 tid=15027 main module=.../app/shared/Require/ResolveCanonicalPath/second.js runtime=23 tid=15107 worker script=./EvalWorker.js module=.../app/shared/Workers/EvalWorker.js runtime=48 tid=15180 worker script=./eventLoopEchoWorker.js module=.../app/tests/eventLoopEchoWorker.js tid 15180 matches the tombstone's crashing thread, whose name the tombstone truncates to W54: ./eventLoo — the breadcrumb supplies the full worker script and the module it was in. SIGABRT verified separately: signal 6 (SIGABRT), code -6 (SI_TKILL), backtrace through abort → LoadModule, breadcrumb pid/tid matching the tombstone exactly. Behaviour change, and why there is no opt-out Fatal signals now surface as real native crashes instead of being converted into JS exceptions, so apps that were "surviving" these will now report them (Play Console / Crashlytics included). That is the point. No opt-out flag is offered deliberately: the old path never actually kept the app running on arm64 — the throw could not unwind out of the signal frame, so it always reached _Exit. There is no "limps on" behaviour to preserve, only "dies opaquely, without a tombstone". An opt-out would be a supported switch that re-enables undefined behaviour and re-disables tombstones. If a specific app regresses, the fault it was hiding is the thing to fix. The disabled exceptionHandlingTests spec asserting that a JNI misuse yields a catchable "SIGABRT" exception is removed along with the behaviour it documented. Testing 878 tests / 0 failures / 0 errors / 4 skipped on the final commit-clean APK. No tombstone during the run and the breadcrumb file was 0 bytes afterwards — no false positives. The 879 → 878 delta is exactly the deleted xit spec: disabled specs still count toward jasmine's total (skipped went 5 → 4). No test regressed. Not verified The "before" snippet is the known prior behaviour, not a measurement re-taken on main for this PR. Everything was verified on one arm64 API 35 emulator. android_set_abort_message's first-write-wins behaviour and debuggerd's abort-message printing could differ on older releases — neither is load-bearing for the shipped design, but the tombstone-chaining is, and that is proven only on API 35. WASM trap handler interaction. V8 installs its own SIGSEGV handler for WASM traps. This is safe by construction — Install() runs at JNI_OnLoad, before V8 init, so V8's handler sits ahead of ours and recoverable traps never reach us — and the WASM specs pass, but a deliberate WASM out-of-bounds trap was not constructed to prove it. Summary by CodeRabbit New Features Added crash breadcrumbs capturing runtime, worker script, module, signal, and thread information. Crash context is persisted and recovered across launches to improve diagnostics after unexpected failures. Bug Fixes Improved fatal-crash handling while preserving existing signal behavior. Removed obsolete platform- and architecture-specific gating for the skipped crash test.

Open Graph Description: Problem SIG_handler was installed for SIGABRT and SIGSEGV and threw a NativeScriptException from inside the signal handler. That is undefined behaviour: the unwinder cannot cross the kernel-built s...

X Description: Problem SIG_handler was installed for SIGABRT and SIGSEGV and threw a NativeScriptException from inside the signal handler. That is undefined behaviour: the unwinder cannot cross the kernel-built s...

Opengraph URL: https://github.com/NativeScript/android/pull/2007

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ffa31cb2-4ba0-2ecf-c5ab-0d4ddfb9d7bf
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAB60:1EC9BC:1591FEB:1B7FDCC:6B0133CB
html-safe-nonce216c39bf41d4dc7e1e28a251a1429d99d9ea5cf752d8b79ad155a4e5824bedd3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjYwOjFFQzlCQzoxNTkxRkVCOjFCN0ZEQ0M6NkIwMTMzQ0IiLCJ2aXNpdG9yX2lkIjoiNjI5OTY1MzAxNTU5OTEzMzY0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc8aee429c9c575f4532d143ba8947e64f952e42e8a1faeb1e150d2847de76ad5
hovercard-subject-tagpull_request:4283172927
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/2007/files
twitter:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
og:image:altProblem SIG_handler was installed for SIGABRT and SIGSEGV and threw a NativeScriptException from inside the signal handler. That is undefined behaviour: the unwinder cannot cross the kernel-built s...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/android git https://github.com/NativeScript/android.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id29137950
octolytics-dimension-repository_nwoNativeScript/android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29137950
octolytics-dimension-repository_network_root_nwoNativeScript/android
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/android/pull/2007/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2007%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2007%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fandroid
Reloadhttps://github.com/NativeScript/android/pull/2007/files
Reloadhttps://github.com/NativeScript/android/pull/2007/files
Reloadhttps://github.com/NativeScript/android/pull/2007/files
NativeScripthttps://github.com/NativeScript
androidhttps://github.com/NativeScript/android
Codehttps://github.com/NativeScript/android
Issues106 (106)https://github.com/NativeScript/android/issues
Pull requests24 (24)https://github.com/NativeScript/android/pulls
Actionshttps://github.com/NativeScript/android/actions
Projectshttps://github.com/NativeScript/android/projects
Wikihttps://github.com/NativeScript/android/wiki
Security and qualityhttps://github.com/NativeScript/android/security
Insightshttps://github.com/NativeScript/android/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
edusperonihttps://github.com/edusperoni
mainhttps://github.com/NativeScript/android/tree/main
fix/native-crash-breadcrumbshttps://github.com/NativeScript/android/tree/fix/native-crash-breadcrumbs
Conversation 4 https://github.com/NativeScript/android/pull/2007
Commits 2 https://github.com/NativeScript/android/pull/2007/commits
Checks 7 https://github.com/NativeScript/android/pull/2007/checks
Files changed https://github.com/NativeScript/android/pull/2007/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2007/files
fix: restore native tombstones and record runtime crash breadcrumbs https://github.com/NativeScript/android/pull/2007/files#top
Show all changes 2 commits https://github.com/NativeScript/android/pull/2007/files
c3fbe51 fix: restore native tombstones and record runtime crash breadcrumbs edusperoni Aug 14, 2026 https://github.com/NativeScript/android/pull/2007/commits/c3fbe517da393f6d3bef83d77f8e402b9658a1af
b04666d fix: close breadcrumb races and restore enclosing module after nested… edusperoni Aug 14, 2026 https://github.com/NativeScript/android/pull/2007/commits/b04666d48ab9942d4ee2cc0e9df9dcaef49e713e
Clear filters https://github.com/NativeScript/android/pull/2007/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2007/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2007/files
exceptionHandlingTests.js https://github.com/NativeScript/android/pull/2007/files#diff-15b4de640ed60e62bfdd9bf0476e529464a83378765360d8907bab8caa47206f
CMakeLists.txt https://github.com/NativeScript/android/pull/2007/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
CrashBreadcrumbs.cpp https://github.com/NativeScript/android/pull/2007/files#diff-81db450b8526cb5292cfcddba4bd2ca674328fdd241bb176a6faca54413303c6
CrashBreadcrumbs.h https://github.com/NativeScript/android/pull/2007/files#diff-06cfbb9d416f1db8fc8e565c3565c577f6480ad0db4395479677098072be1390
ModuleInternal.cpp https://github.com/NativeScript/android/pull/2007/files#diff-8fb647a9437c57deb39dc2079f0cdfc94a75fafef82b46766fd7d1d276af246e
Runtime.cpp https://github.com/NativeScript/android/pull/2007/files#diff-b9490640f5d26f7cd6b9a176a2142b8e985a6aac9e2d64287de37fc694e80cc3
WorkerWrapper.cpp https://github.com/NativeScript/android/pull/2007/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
test-app/app/src/main/assets/app/tests/exceptionHandlingTests.jshttps://github.com/NativeScript/android/pull/2007/files#diff-15b4de640ed60e62bfdd9bf0476e529464a83378765360d8907bab8caa47206f
View file https://github.com/NativeScript/android/blob/b04666d48ab9942d4ee2cc0e9df9dcaef49e713e/test-app/app/src/main/assets/app/tests/exceptionHandlingTests.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2007/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2007/files#diff-15b4de640ed60e62bfdd9bf0476e529464a83378765360d8907bab8caa47206f
test-app/runtime/CMakeLists.txthttps://github.com/NativeScript/android/pull/2007/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
View file https://github.com/NativeScript/android/blob/b04666d48ab9942d4ee2cc0e9df9dcaef49e713e/test-app/runtime/CMakeLists.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2007/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2007/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
https://github.com/NativeScript/android/pull/2007/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
test-app/runtime/src/main/cpp/CrashBreadcrumbs.cpphttps://github.com/NativeScript/android/pull/2007/files#diff-81db450b8526cb5292cfcddba4bd2ca674328fdd241bb176a6faca54413303c6
View file https://github.com/NativeScript/android/blob/b04666d48ab9942d4ee2cc0e9df9dcaef49e713e/test-app/runtime/src/main/cpp/CrashBreadcrumbs.cpp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2007/{{ revealButtonHref }}
Please reload this pagehttps://github.com/NativeScript/android/pull/2007/files
test-app/runtime/src/main/cpp/CrashBreadcrumbs.hhttps://github.com/NativeScript/android/pull/2007/files#diff-06cfbb9d416f1db8fc8e565c3565c577f6480ad0db4395479677098072be1390
View file https://github.com/NativeScript/android/blob/b04666d48ab9942d4ee2cc0e9df9dcaef49e713e/test-app/runtime/src/main/cpp/CrashBreadcrumbs.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2007/{{ revealButtonHref }}
Please reload this pagehttps://github.com/NativeScript/android/pull/2007/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.