From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2026-11-16T17:42:32+00:00 Subject: [ruby-core:127510] [Ruby Bug#22471] Thread#name= on a terminated thread may dump core Issue #22471 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.3: REQUIRED, 3.4: DONE, 4.0: REQUIRED to 3.3: REQUIRED, 3.4: DONE, 4.0: DONE ruby_4_0 commit:e041213778c7bfc557b0cecee37f1c82098a0988 merged revision(s) commit:6fdd4520878eebd737d2a702c62051d46f199f89. ---------------------------------------- Bug #22471: Thread#name= on a terminated thread may dump core https://bugs.ruby-lang.org/issues/22471#change-119978 * Author: mame (Yusuke Endoh) * Status: Closed * Backport: 3.3: REQUIRED, 3.4: DONE, 4.0: DONE ---------------------------------------- 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/