Actions
Bug #20221
closedASAN: make test-basic: un-prefixed symbol leakage
Description
When building and running the tests (here, test-basic) with ASAN enabled, it fails with the following message:
Checking leaked global symbols...leaked
__odr_asan_gen_rb_cArray
__odr_asan_gen_ruby_digitmap
__odr_asan_gen_rb_mComparable
...snip...
__odr_asan_gen_OnigEncodingASCII
__odr_asan_gen_OnigEncodingUS_ASCII
__odr_asan_gen_OnigEncodingUTF_8
232 un-prefixed symbols leaked
To reproduce:
git checkout master
mkdir build && cd build
CXX=clang++ CC=clang ../configure cppflags="-fsanitize=address -fno-omit-frame-pointer" optflags=-O0 LDFLAGS="-fsanitize=address -fno-omit-frame-pointer"
ASAN_OPTIONS=use_sigaltstack=0:detect_leaks=0:abort_on_error=1 make
ASAN_OPTIONS=use_sigaltstack=0:detect_leaks=0:abort_on_error=1 make test-basic
To fix:
diff --git a/tool/leaked-globals b/tool/leaked-globals
index ee75f78d1d..9e78228274 100755
--- a/tool/leaked-globals
+++ b/tool/leaked-globals
@@ -79,6 +79,7 @@
next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "")
next if n.include?(".")
next if !so and n.start_with?("___asan_")
+ next if n.start_with?("__odr_asan")
case n
when /\A(?:Init_|InitVM_|pm_|[Oo]nig|dln_|coroutine_)/
next
I'm not overly familiar with Ruby, so this might not be the preferred approach, but it made the issue go away for me.
Actions
Like0
Like0Like0Like0