From: "nagachika (Tomoyuki Chikanaga) via ruby-core" Date: 2026-11-08T05:07:45+00:00 Subject: [ruby-core:127353] [Ruby Bug#22471] Thread#name= on a terminated thread may dump core Issue #22471 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED to 3.3: REQUIRED, 3.4: DONE, 4.0: REQUIRED ruby_3_4 commit:d545840aa6297fb93d9ffb3e44ac944ace009ce7 merged revision(s) commit:6fdd4520878eebd737d2a702c62051d46f199f89. ---------------------------------------- Bug #22471: Thread#name= on a terminated thread may dump core https://bugs.ruby-lang.org/issues/22471#change-119786 * Author: mame (Yusuke Endoh) * Status: Closed * Backport: 3.3: REQUIRED, 3.4: DONE, 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/