Skip to content
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

Correctly report native-lib filenames when still packed in APK files #1705

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Jun 17, 2022

Goal

Ensure that .so files are reported by name (where possible) when the native libraries are not extracted from the .apk file. When packaged correctly, the operating system may load the .so files from within the .apk file in order to save space and time (see extractNativeLibs and useLegacyPackaging for more information).

Symbols for these files were sometimes being reported as coming from base.apk instead of the expected .so file, and as a result were not displaying the correct symbols on the Dashboard.

Changes

Updated the dladdr fallback logic in the stack unwinder to look for filenames ending in .apk. If these are found, the filename is either resolved from the Elf.soname (in the case of handled errors) or dladdr (in the case of signals).

Testing

The test fixtures now use extractNativeLibs=false which previously would cause them to fail when the symbols could not be read. The symbolicate function used by Mazerunner now looks for the ! indicator in filenames, and retrieves the correct filename when symbolicating native stack traces for tests.

Notes

dladdr on Android 6 reports base.apk as the filename if the library has not been unpacked, so one of our existing scenarios (Causing a crash in a separate library / CXXExternalStackElementScenario) cannot correctly report its filename. This scenario is now skipped on Android 6.

@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Jun 17, 2022

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1868.07 1615.76
arm64_v8a 655.76 405.9
armeabi_v7a 590.23 340.37
x86 729.47 479.61
x86_64 700.8 450.95

Generated by 🚫 Danger

@lemnik lemnik marked this pull request as ready for review June 17, 2022 16:01
@lemnik lemnik requested a review from kattrali June 17, 2022 16:01
@lemnik lemnik force-pushed the PLAT-8587/handle-packed-libs branch from 94b6fd0 to 6411245 Compare June 22, 2022 15:34
…inside an apk file during native reports and crashes
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.

3 participants