Skip to content

fix: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) crashes #1545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2019

Conversation

DickSmith
Copy link
Contributor

@DickSmith DickSmith commented Nov 29, 2019

Description

Various signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) crashes reported in Google Play. Occur at a ~0.4-0.5% crash rate. Usually Android 9 (sometimes 7/8/10). I see there is a similar handler for SIGABRT on those versions, so I just expanded that to include SIGSEGV.

Does your commit message include the wording below to reference a specific issue in this repo?

Fixes #1413

Does your pull request have unit tests?

No idea how to test this from the JS like SIGABRT. However, prior to this change I was getting hundreds of these a day, and now almost 0 (the very few still are those < API 25).

@cla-bot cla-bot bot added the cla: yes label Nov 29, 2019
sigaction(SIGABRT, &SIGABRT_action, NULL);

struct sigaction SIGSEGV_action;
SIGSEGV_action.sa_handler = SIGSEGV_handler;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can reuse the same signal handler for both signals, since the behaviour is quite similar (throw a NativeScriptException).

@DickSmith
Copy link
Contributor Author

@darind
I've updated the PR to handle both signals in the same method.
I've also expanded to include > API 20 since there were still a a large number of crashes for tgkill (SIGABRT) and SIGSEGV on those older versions.
Verified by internal QA and against 310K+ users in production, with no crashes of either type present on any Android versions on Google Play, and instead I see them being reported as non-fatals in Crashlytics (which is how I handle Uncaught and Discarded errors).
(In fact, the Google Play Pre-launch report did not crash with the Huawai P8 on Android 5.0 for the first time ever, which was never reported in Prod/Release, but still a good sign.)
The app only supports API 21+, so did not validate below that.

@darind darind merged commit 92b90a1 into NativeScript:master Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android 9: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) in libNativeScript.so
2 participants