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

Is there any plans to bring the backtrace function to Android? #925

Closed
ghost opened this issue Mar 4, 2019 · 7 comments
Closed

Is there any plans to bring the backtrace function to Android? #925

ghost opened this issue Mar 4, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented Mar 4, 2019

Hello,

Is there any plans to bring the backtrace (http://man7.org/linux/man-pages/man3/backtrace.3.html) function to Android? This is a very common function to retrieve the stack trace.

Thankfully.

@enh
Copy link
Contributor

enh commented Mar 4, 2019

@cferris1000 plans to make this available in the NDK at some point.

@ghost
Copy link
Author

ghost commented Mar 4, 2019

@enh @cferris1000 Please, that would be pretty lovely :) Thank you very much.

@DanAlbert DanAlbert added this to the external dependency milestone Mar 4, 2019
@gpakosz
Copy link

gpakosz commented Jun 3, 2019

What's the difficulty in exposing backtrace. Last time I discussed it was in 2017 and it seems the heavy work landed then, see https://groups.google.com/d/msg/android-ndk/hhUv1mg3c_A/rOeW2woGBAAJ

@DanAlbert
Copy link
Member

AIUI the expected issues (I don't think @cferris1000 has had time to look yet) are that the new library has only ever been built against the latest API level (minSdkVersion 28 is a dealbreaker, and I suspect there's some porting involved), and that it depends on some other non-NDK libraries (https://android.googlesource.com/platform/system/core/+/0c615194f499c6c197fec43ea038dad625da8f98/libunwindstack/Android.bp#128), which we'll need to find some solution for.

We'll also want to make sure we've tested it very thoroughly, and make sure that new libraries using the new unwinder can still interop with the old one so we don't repeat the same pain caused by libgcc -> libunwind incurred by ARM32 libc++.

None of those things are particularly challenging, but they do take time and no one has had the time yet.

@gpakosz
Copy link

gpakosz commented Jun 3, 2019

Thanks for the details @DanAlbert, appreciated 👍

@enh-google
Copy link
Collaborator

fwiw, the <execinfo.h> header and its three functions were added to Android T (aka Android 13) in https://android-review.googlesource.com/c/platform/bionic/+/1863333

@DanAlbert
Copy link
Member

Closing since Android now has this API, and the libunwindstack source is usable by anyone that needs to backport that. There aren't any real plans (we'd love to, but realistically it's not getting prioritized) to provide a trivially imported version of the library for apps (an AAR). If we're underestimating the importance of providing an AAR for this, please let us know :)

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

No branches or pull requests

4 participants