-
Notifications
You must be signed in to change notification settings - Fork 261
Fails to symbolicate when loaded as a .so on android #151
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
Comments
Worth noting that on android shared object loading can be a bit weird, the object will often be loaded from inside the .apk (a zip file) directly, which their loader supports. I'm not sure if this impacts how you symbolicate though. |
This does indeed sound bad! Unfortunately though it doens't sound familiar so it'd take some effort to investigate this. I don't have a ton of time right now to look into this, but if someone has questions that I can help with I can try to do that! |
Do you have any advice on where you'd start digging? E.g. Is this likely to be libbacktrace, the rust code, etc? I don't mind looking into it, but I'm not exactly sure how all this fits together. |
My guess is that the Rust code probably isn't at fault here but probably something within libbacktrace. Unfotunately though libbacktrace is somewhat difficult to debug. You could also try tweaking the various features of this crate which controls which strategy is used for symbolication. One possible candidate is libbacktrace finding and loading the ELF file image, which on Linux uses |
Dynamically determine at build time whether the Android API version is high enough such that we can enable the usage of `dl_iterate_phdr`. This means that builds for old API revisions like libstd won't pull in new binary deps, but builds on crates.io of this crate with newer toolchains should have better backtraces by default. Some tests for actually executing Android tests have now been enabled on CI as well which were failing previously and after this change are now working. Closes #151 Closes #227
I don't think this was resolved by #228. I am getting backtraces when running a |
I have a rust binary loading a c shared library via I'd be happy to help debug this if you can point me in the right direction? |
Can a new issue be opened for this? The reason this doesn't work is due to android not being listed here -- backtrace-rs/src/symbolize/gimli.rs Lines 362 to 369 in c6e5bff
|
I am using If I set My hunch is that something in this section is only matching exactly backtrace-rs/crates/backtrace-sys/build.rs Lines 145 to 168 in c6e5bff
|
I confirmed that |
Note that the detection there is not part of the gimli implementation, it may need to get ported to the gimli implementation, however. Until I wouldn't recommend using the libbacktrace implementation because it's likely to get removed at some point and it's historically had at least a few bugs which could lead to segfaults or worse. |
is gimli support for |
@alexcrichton Thanks! I'll take that under advisement. For what it's the cause is Android loading the shared library directly from the apk instead of extracting it to disk during install. Setting Cheers! |
@s1341 it needs someone to send a PR effectively. @kjvalencik glad it works for you! |
@alexcrichton I can take a hint! I'm not sure I'll have time for it soon though... |
@s1341 I got the ball rolling by opening a PR to I have a local branch of |
If rust code using backtrace is loaded on android as a .so, symbolication always fails, even if symbols are available.
We've also seen it cause crashes due to OOM on arm android (32 and 64 bit) in the wild (mozilla/application-services#441, also other reports), which may or may not be related.
The text was updated successfully, but these errors were encountered: