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

Update NDK unwinding logic #1605

Merged
merged 4 commits into from
Feb 23, 2022

Conversation

kattrali
Copy link
Contributor

@kattrali kattrali commented Feb 23, 2022

Goal

Provide a backport of libunwindstack from android 12.0.0r31 compatible with API level 14. Consolidates to use a single unwinding implementation across everything.

This change is targeting an integration branch as there are additional required improvements, but this changeset has become large enough already. This is 1 of (probably) 3.

Changeset

⚠️ Don't panic - the vast majority of the changeset is removing now-unused files. The easiest way to understand the changes is to view each commit separately.

  • Updated the unwinder. This required a few changes to the internals, but there are now two paths to unwind, one intended for a crashing context.
  • Bumped the NDK revision used to build to r23 - an update from r17 was necessary for c++17 language features, and the guidance specifies that newer is better when you can't match the target app's version exactly.

Testing

  • Added a few new unit tests for the unwinder, which run on x86 / x64 / arm32 / arm64
  • Tested manually that the stack contents are correct, mapping files are applied, and events group across architectures on arm32 and arm64 running on android 4.4, 5, 9, 11, and 12.

* removes "unwind style" logic in favor of a unified interface
* updates C++ standard to c++17 (required for unwindstack's use of
  optional, etc)
* splits unwinding into separate functions for signal/exception-time and
  user-generated events
Bumping is required to compile with c++17 language features

Use latest LTS, per guidance for middleware vendors

> NDK versions are largely compatible with each other, but occasionally
there are changes that break compatibility. If you know that all of your
users are using the same version of the NDK, it's best to use the same
version that they do. Otherwise, use the newest version.

https://developer.android.com/ndk/guides/middleware-vendors

change requires update to root_detection to use 3-param open(2)

[full ci]
@kattrali kattrali requested a review from lemnik February 23, 2022 09:30
@bugsnagbot
Copy link
Collaborator

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 2212.77 1966.73
arm64_v8a 737.68 491.92
armeabi -492.59 -21.55
armeabi_v7a 672.15 426.39
x86 811.39 569.72
x86_64 782.72 541.06

Generated by 🚫 Danger

Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

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

LGTM!

@kattrali kattrali merged commit 07049b3 into integration/update-unwinder Feb 23, 2022
@kattrali kattrali deleted the kattrali/update-ndk-unwinder branch February 23, 2022 16:13
This was referenced Mar 17, 2022
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