This is an archive of the discontinued LLVM Phabricator instance.

[hwasan_symbolize] Make hwasan_symbolize compatible with Android fuzzing out-of-box.
AbandonedPublic

Authored by hctim on Mar 4 2020, 11:43 AM.

Details

Reviewers
eugenis
Summary

hwasan_symbolize assumes that all the symoblized binaries and DSO's are under $ANDROID_PRODUCT_OUT/symbols. This is not the case
with cc_fuzz targets on Android, as they have fully symbolized binaries and DSO/s under $ANDROID_PRODUCT_OUT/data/fuzz, with
no corresponding entry under /symbols.

Add just the raw $ANDROID_PRODUCT_OUT as a symbol search path.

Diff Detail

Event Timeline

hctim created this revision.Mar 4 2020, 11:43 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 4 2020, 11:43 AM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
eugenis added inline comments.Mar 5 2020, 4:43 PM
compiler-rt/lib/hwasan/scripts/hwasan_symbolize
204

It's not about /data/fuzz specifically. Maybe say that we fallback to $ANDROID_PRODUCT_OUT if the binary can not be found under "symbols" because some targets (ex. fuzzers) install unstripped binaries to the device.

Is this something that should be (could be?) fixed on the Android side? It's the common convention to put unstripped binaries under symbols. Ex. apex generation goes to great lengths to set up paths under symbols/ to match runtime mount path of the apex on device.

hctim abandoned this revision.Mar 6 2020, 9:40 AM
hctim marked an inline comment as done.
hctim added inline comments.
compiler-rt/lib/hwasan/scripts/hwasan_symbolize
204

Yeah, agreed. Symbol reexporting available here: https://android-review.googlesource.com/c/platform/build/soong/+/1252144