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

Fix inconsistencies in stack trace quality for C/C++ events #1611

Merged
merged 16 commits into from
Mar 14, 2022

Conversation

kattrali
Copy link
Contributor

@kattrali kattrali commented Mar 4, 2022

⚠️ Depends on #1610 being merged first

Changeset

Testing

kattrali and others added 12 commits February 22, 2022 18:02
* 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]
reduce the surface of API, which expanded quite a bit with updated
unwindstack.

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

debug builds export additional symbols used in the tests

This change requires removal of code which re-throws types defined in
binaries other than libbugsnag-ndk, because if the type has been hidden,
then the throw invocation will trigger an immediate termination
(skipping the crash report), or if the type is custom (e.g. a subclass
of std::runtime_error, etc), then no useful message was detected anyway,
as the type information is likely not available.

Useful reading on the topic:

* https://gcc.gnu.org/wiki/Visibility (specifically "Problems with C++
  exceptions")
* https://developer.android.com/ndk/guides/common-problems#rttiexceptions_not_working_across_library_boundaries
* https://developer.android.com/ndk/guides/cpp-support#ic
* https://en.cppreference.com/w/cpp/language/definition (section on ODR)

Technically this lib should not export std:: symbols but this at least
preserves existing behavior until its re-evaluated.

[full ci]
Removes the double free scenario, as the exact crashing condition is
dependent on undefined behavior, and thus can't assert an exact
location.

Refactors several existing tests to have their own files for their
native components with the intent to:

1. Make the native functions easier to find - one big file is getting
   unwieldy
2. Make line number assertions stable, avoiding changes if unrelated
   tests change

Avoids asserting on inconsistent behavior - for example
CXXStackoverflowScenario always crashes in the same function but line
info may not be available on arm32.
@kattrali kattrali requested a review from lemnik March 4, 2022 11:51
@kattrali kattrali force-pushed the integration/update-unwinder branch from da24fae to 7e01a7a Compare March 4, 2022 14:30
@kattrali kattrali force-pushed the integration/update-unwinder branch from b08128b to 0f1257f Compare March 14, 2022 09:39
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 - Pending resolution of the new merge conflicts

@kattrali kattrali merged commit 705e1f0 into next Mar 14, 2022
@kattrali kattrali deleted the integration/update-unwinder branch June 30, 2022 09:03
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