From: "mame (Yusuke Endoh) via ruby-core" Date: 2026-10-24T19:32:15+00:00 Subject: [ruby-core:127230] [Ruby Bug#22471] Thread#name= on a terminated thread may dump core Issue #22471 has been reported by mame (Yusuke Endoh). ---------------------------------------- Bug #22471: Thread#name= on a terminated thread may dump core https://bugs.ruby-lang.org/issues/22471 * Author: mame (Yusuke Endoh) * Status: Open * Backport: 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- Calling `Thread#name=` on a terminated thread calls `pthread_setname_np()` with an invalid `pthread_t`, which can cause a SEGV or rename an unrelated thread. ```ruby ts = 100.times.map { Thread.new {} }.each(&:join) ts.each { |t| t.name = "x" } ``` ``` $ ruby -v test.rb ruby 4.1.0dev (2026-08-21T07:50:27Z master c9e9101403) +PRISM [x86_64-linux] test.rb:2: [BUG] Segmentation fault at 0x0000716a88eae990 ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/