[ruby-core:123990] [Ruby Bug#21759] `test_fork.rb:78` is failing with `RUBY_MN_THREADS=1`
Issue #21759 has been reported by hsbt (Hiroshi SHIBATA). ---------------------------------------- Bug #21759: `test_fork.rb:78` is failing with `RUBY_MN_THREADS=1` https://bugs.ruby-lang.org/issues/21759 * Author: hsbt (Hiroshi SHIBATA) * Status: Open * 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) #=> #<Assertion::Timeout: timed out after 180 seconds> (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/
Issue #21759 has been updated by luke-gru (Luke Gruber). Assignee set to ractor ---------------------------------------- Bug #21759: `test_fork.rb:78` is failing with `RUBY_MN_THREADS=1` https://bugs.ruby-lang.org/issues/21759#change-115601 * Author: hsbt (Hiroshi SHIBATA) * Status: Open * Assignee: ractor * 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) #=> #<Assertion::Timeout: timed out after 180 seconds> (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/
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) #=> #<Assertion::Timeout: timed out after 180 seconds> (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/
Issue #21759 has been updated by hsbt (Hiroshi SHIBATA). Thank you! I have also run the test over 10 times to make sure there are no failures with `RUBY_MN_THREADS=1`. ---------------------------------------- Bug #21759: `test_fork.rb:78` is failing with `RUBY_MN_THREADS=1` https://bugs.ruby-lang.org/issues/21759#change-115620 * 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) #=> #<Assertion::Timeout: timed out after 180 seconds> (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/
participants (2)
-
hsbt (Hiroshi SHIBATA) -
luke-gru (Luke Gruber)