fix(ndk): Ensure 64-bit devices running 32-bit binaries do not use 32-bit device unwinding logic #383
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.
Small refactor of the API 21+ stack unwinding logic to restrict 32-bit
unwinding style from 64-bit devices.
While the stack enhancements added in #378 are intended only to be run
on 32-bit devices and gated to the arm build, when 64-bit devices
are running the 32-bit library, the stacktraces for those devices were
unintentionally affected.
This is the case when an app is configured to only run 32-bit binaries
(Android cannot run both 64-bit and 32-bit binaries at once), and many
popular libraries (e.g. React Native) only distribute 32-bit libraries.
Added additional improvement to the 32-bit stacktrace resolution by
switching to nongnu libunwind only for those devices. This significantly
improves the number of frames which can be unwound without risk of a
segfault.
Tests
raise(signum)
,abort()
, floating point exceptions, and invalid casts. With the exception ofabort()
the stacktrace is improved.To reproduce the original problem add ABI filters to an apps gradle config to only load 32-bit binaries:
Discussion
Linked issues
Fixes #382
Related to #380
Review
For the pull request reviewer(s), this changeset has been reviewed for: