[compiler-rt] [asan] Report executable/DSO name for report_globals=2 and odr-violation checking (PR #71879)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 10 10:04:42 PST 2023
================
@@ -80,14 +80,16 @@ static bool IsAddressNearGlobal(uptr addr, const __asan_global &g) {
}
static void ReportGlobal(const Global &g, const char *prefix) {
+ DataInfo info;
+ bool symbolized = Symbolizer::GetOrInit()->SymbolizeData(g.beg, &info);
Report(
- "%s Global[%p]: beg=%p size=%zu/%zu name=%s module=%s dyn_init=%zu "
+ "%s Global[%p]: beg=%p size=%zu/%zu name=%s source=%s module=%s "
+ "dyn_init=%zu "
"odr_indicator=%p\n",
prefix, (void *)&g, (void *)g.beg, g.size, g.size_with_redzone, g.name,
- g.module_name, g.has_dynamic_init, (void *)g.odr_indicator);
+ g.module_name, info.module, g.has_dynamic_init, (void *)g.odr_indicator);
----------------
MaskRay wrote:
Good catch. It's `nullptr` and will be printed as `<null>`. `(symbolized ? info.module : "")` will be better.
https://github.com/llvm/llvm-project/pull/71879
More information about the llvm-commits
mailing list