This is an archive of the discontinued LLVM Phabricator instance.

ASAN: keep support for Global::location
ClosedPublic

Authored by marxin on Feb 20 2023, 12:10 PM.

Details

Summary

We as GCC still emit __asan_global_source_location for global variables
and we would like to use it in the future. On other hand, we don't
support llvm-symbolizer and the default libbacktraace symbolizer
does not support location info.

Related to: https://reviews.llvm.org/D127552

Diff Detail

Event Timeline

marxin created this revision.Feb 20 2023, 12:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2023, 12:10 PM
Herald added a subscriber: Enna1. · View Herald Transcript
marxin requested review of this revision.Feb 20 2023, 12:10 PM

we don't support llvm-symbolizer and the default libbacktraace symbolizer does not support location info.

is there any chance of fixing this in future?

a longer-term goal is to actually ULEB-stream-compress these __asan_global descriptors to save binary size, which would mean that we'd waste a byte-per-global on this field :(. it would be great to allow that to happen.

compiler-rt/lib/asan/asan_interface_internal.h
56–59

can you please make this gcc_location, and add a comment explaining that clang uses DWARF for asan global symbolization rather than inlining it in the metadata.

we don't support llvm-symbolizer and the default libbacktraace symbolizer does not support location info.

is there any chance of fixing this in future?

Yes, we're discussing learning that to libbacktrace library:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108870

marxin updated this revision to Diff 499802.Feb 23 2023, 3:56 AM
marxin marked an inline comment as done.Feb 23 2023, 3:58 AM
hctim accepted this revision.Feb 23 2023, 9:35 AM
This revision is now accepted and ready to land.Feb 23 2023, 9:35 AM
This revision was landed with ongoing or failed builds.Feb 24 2023, 12:11 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 24 2023, 12:11 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript

we don't support llvm-symbolizer and the default libbacktraace symbolizer does not support location info.

is there any chance of fixing this in future?

Yes, we're discussing learning that to libbacktrace library:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108870

For future patches, it'd be good to include such a feature request link to the summary/commit message :)