From: "luke-gru (Luke Gruber) via ruby-core" Date: 2025-12-11T15:57:39+00:00 Subject: [ruby-core:124147] [Ruby Bug#21759] `test_fork.rb:78` is failing with `RUBY_MN_THREADS=1` Issue #21759 has been updated by luke-gru (Luke Gruber). Status changed from Open to Closed Assignee changed from ractor to luke-gru (Luke Gruber) This has most likely been fixed by https://github.com/ruby/ruby/pull/15392. I can't reproduce the failure on master and the fix was targeting a race condition in the thread scheduler in MN thread mode. ---------------------------------------- Bug #21759: `test_fork.rb:78` is failing with `RUBY_MN_THREADS=1` https://bugs.ruby-lang.org/issues/21759#change-115602 * Author: hsbt (Hiroshi SHIBATA) * Status: Closed * Assignee: luke-gru (Luke Gruber) * ruby -v: ruby 4.0.0dev (2025-12-01T18:02:35Z master f92001344d) +YJIT +MN +PRISM [arm64-darwin25] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- The following failure of `make btest` is happend with `RUBY_MN_THREADS=1`. ``` #289 test_fork.rb:78: def now = Process.clock_gettime(Process::CLOCK_MONOTONIC) Thread.new do loop { sleep 0.0001 } end 10.times do pid = fork{ exit!(0) } deadline = now + 10 while true _, status = Process.waitpid2(pid, Process::WNOHANG) break if status if now > deadline Process.kill(:KILL, pid) raise "failed" end sleep 0.001 end unless status.success? raise "child exited with status #{status}" end (...snip) #=> # (expected "ok") [Bug #20670] ``` This failure occurred 4 times out of 5 times. But I couldn't reproduce this when I removed `RUBY_MN_THREADS` at 5 times. -- 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/