-
Notifications
You must be signed in to change notification settings - Fork 125
Dynamically look up backtrace(3)
on Android.
#1356
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
base: main
Are you sure you want to change the base?
Conversation
The `backtrace()` function on Android was added with API level 33, but at least some external Android builds target earlier Android NDKs, so we'll dynamically look up the function. If it's not present or dynamic loading isn't available, we just produce an empty backtrace. Resolves #1135.
Should we just wait for |
No, because the signature is not consistent (optionality has changed) between the different toolchains floating around out there. So even with |
The signature issue is irrelevant: the only one that matters is the one currently in Bionic. The other signature comes from my Android SDK bundle, which uses a Termux library that was backported to API 24, but I'm sunsetting my bundle in favor of the official SDK bundle that we're working on, which will simply delegate to the Bionic headers in the NDK. |
You're the domain expert, so if you think we should wait, I defer to you. However this change will also work even without |
I'm not too worried about backwards compatibility, particularly considering I only got this library building for Android earlier this year. I'm certainly no expert on Thanks for working on this, but that was my only concern. |
I think it really depends on how long until |
Mads is working on it and while he hit some stumbling blocks in that pull, hopefully we can add it soon, let's see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no particular opposition to this landing in the short term, even if we later adopt a better availability check
I'll leave it to @finagolfin to decide. |
I'd rather avoid these old C methods if |
The
backtrace()
function on Android was added with API level 33, but at least some external Android builds target earlier Android NDKs, so we'll dynamically look up the function. If it's not present or dynamic loading isn't available, we just produce an empty backtrace.See: https://cs.android.com/android/_/android/platform/bionic/+/731631f300090436d7f5df80d50b6275c8c60a93:libc/include/execinfo.h;l=52
Resolves #1135.
Checklist: