Project

General

Profile

Actions

Bug #20221

closed

ASAN: make test-basic: un-prefixed symbol leakage

Added by leeN (David Klein) 10 months ago. Updated 10 months ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-01-29T08:16:49Z master 8bff7e996c)
[ruby-core:116473]

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.


Related issues 1 (1 open0 closed)

Related to Ruby master - Misc #20387: Meta-ticket for ASAN supportAssignedkjtsanaktsidis (KJ Tsanaktsidis)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0