-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add device llvm-symbolizer to NDK #753
Comments
Is this still needed, or was the work done by this rolled into ndk-stack? @enh-google |
It would provide slightly better user experience, because sanitizer reports would come out pre-symbolized. But ndk-stack is enough to get all the same info, just with extra steps. |
would Studio support that workflow? i thought dan said it's hard to get symbols onto the device because Studio (cmake?) doesn't believe in that? |
@hhb is in the middle of refactoring our build and changing the process by which we build many of the device components now. Once that is converted over, we could build and package the extra device binaries for |
AGP will strip symbols for the APK by default, but you can override it with packagingOptions {
doNotStrip {
"libs/*/libfoo.so"
}
} or something like that. It's not going to be the common case by any means. I think I'll close this for now. If we get users asking for it we'll reopen, but I think in practice everyone will need ndk-stack anyway. |
I just found about this issue. I have a binary that definitely contains symbols and debug information, as tracy on it is able to show perfect stacks without being pointed to any additional symbols file/directory. Now I'm running it with ASan, and getting ASan stacks on stderr like:
I've tried feeding that to Reading closer the doc, I learned that I should try to put a logcat-like marker line like
Once I did this,
But still nothing else. So, it looks like Finally, consider that even if all these issues with As stated at the beginning, Tracy is able to symbolize all these stacks, so if |
@bjacob |
ndk-stack should (despite the TODO) cope; @eugenis added support (see the
ah, but that was https://android-review.googlesource.com/c/platform/ndk/+/1225302 which will have been too late for r21. r22beta1 should have this though. |
I just downloaded NDK r22 beta 1 but still can't find any device build of llvm-symbolizer. Only the same host build as in r21:
Thanks for the tip, retrying ndk-stack with r22 beta 1 now ... |
@enh-google I've tried ndk-stack from r22 beta 1 now. Issues:
which ndk-stack is unable to symbolize because it's not in the directory that I passed in
For reference: Here is the raw output from ASan:
Here is what ndk-stack shows:
Here is what a simple script using
|
You just paste some ASan output to a text file and feed that to stdin to this script. It will then pull the files out of the device and symbolize them on the host using the NDK-provided host build of llvm-symbolizer. Because it just pulls files from the device, there's no need to point this script to any particular obj dir. It's easy to use. ANDROID_NDK=~/android-ndk-r21d ~/android-symbolize.sh < ~/a Discussion of alternatives: android/ndk#753
…n. (#3673) * Add script to symbolize android stacks, particularly for use with Asan. You just paste some ASan output to a text file and feed that to stdin to this script. It will then pull the files out of the device and symbolize them on the host using the NDK-provided host build of llvm-symbolizer. Because it just pulls files from the device, there's no need to point this script to any particular obj dir. It's easy to use. ANDROID_NDK=~/android-ndk-r21d ~/android-symbolize.sh < ~/a Discussion of alternatives: android/ndk#753 * rename
The easiest way to get symbolized reports from ASan is with on-device llvm-symbolizer binary.
Currently, NDK provides only a host binary.
Both asan_device_setup and wrap.sh-based workflows can automate symbolization setup (with wrap.sh we would add llvm-symbolizer to the apk and set ASAN_OPTIONS or ASAN_SYMBOLIZER_PATH).
The text was updated successfully, but these errors were encountered: