Project

General

Profile

Actions

Bug #20910

closed

leaked-globals not happy about dtrace related symbols

Added by Kulikjak (Jakub Kulik) 23 days ago. Updated 19 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [amd64-solaris2.11]
[ruby-core:120012]

Description

I am not sure if this is Solaris specific, but when I build Ruby 3.3.6 with dtrace enabled and run its test suite, the leaked-globals checker fails with the following:

Checking leaked global symbols...48 un-prefixed symbols leaked
leaked
  __dtraceenabled_ruby___array-create
  __dtrace_ruby___array-create
  __dtraceenabled_ruby___raise
  __dtrace_ruby___raise
  __dtraceenabled_ruby___gc-sweep-begin
....

I believe that these are not problematic and can be there.

The following simple change fixed the issue:

--- ruby-3.3.6/tool/leaked-globals
+++ ruby-3.3.6/tool/leaked-globals
@@ -73,6 +73,8 @@ IO.foreach("|#{NM} #{ARGV.join(' ')}") d
   case n
   when /\A(?:Init_|InitVM_|pm_|[Oo]nig|dln_|coroutine_)/
     next
+  when /\A__dtrace/
+    next
   when /\Aruby_static_id_/
     next unless so
   when /\A(?:RUBY_|ruby_|rb_)/

Updated by nobu (Nobuyoshi Nakada) 22 days ago

Or does this help?

diff --git a/tool/leaked-globals b/tool/leaked-globals
index 05ce02658b7..6118cd56e81 100755
--- a/tool/leaked-globals
+++ b/tool/leaked-globals
@@ -90,6 +90,7 @@
   next if !so and n.start_with?("___asan_")
   next if !so and n.start_with?("__odr_asan_")
   next if !so and n.start_with?("__retguard_")
+  next if !so and n.start_with?("__dtrace")
   case n
   when /\A(?:Init_|InitVM_|pm_|[Oo]nig|dln_|coroutine_)/
     next

Updated by Kulikjak (Jakub Kulik) 22 days ago

Hi. Yes, this works as well.

Actions #3

Updated by nobu (Nobuyoshi Nakada) 19 days ago

  • Status changed from Open to Closed

Applied in changeset git|8149f4d6abd4df27d07c047b133451a1364f8d9a.


[Bug #20910] dtrace related symbols are not considered leaked

Actions

Also available in: Atom PDF

Like0
Like1Like0Like0