https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112017-12-19T06:36:32ZRuby Issue Tracking SystemRuby master - Bug #14090: `TestGc#test_interrupt_in_finalizer` fails very rarelyhttps://redmine.ruby-lang.org/issues/14090?journal_id=685172017-12-19T06:36:32Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>2.5</i></del>)</li></ul> Ruby master - Bug #14090: `TestGc#test_interrupt_in_finalizer` fails very rarelyhttps://redmine.ruby-lang.org/issues/14090?journal_id=917042021-04-27T02:08:33Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>I tried the following patch to disable the mitigation:</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gh">diff --git a/thread.c b/thread.c
index 4f2debdaf2..0fdef76445 100644
</span><span class="gd">--- a/thread.c
</span><span class="gi">+++ b/thread.c
</span><span class="p">@@ -601,13 +601,12 @@</span> rb_thread_terminate_all(rb_thread_t *th)
terminate_all(cr, th);
while (rb_ractor_living_thread_num(cr) > 1) {
<span class="gd">- rb_hrtime_t rel = RB_HRTIME_PER_SEC;
</span> /*q
* Thread exiting routine in thread_start_func_2 notify
* me when the last sub-thread exit.
*/
sleeping = 1;
<span class="gd">- native_sleep(th, &rel);
</span><span class="gi">+ native_sleep(th, 0);
</span> RUBY_VM_CHECK_INTS_BLOCKING(ec);
sleeping = 0;
}
<span class="err">
</span></code></pre>
<p>I then ran the <code>test_interrupt_in_finalizer</code> test 10,000 times without it failing. Are we sure this is still a problem? Maybe it depends on the operating system, as I'm running on OpenBSD and I'm guessing the problem was observed on Linux?</p>
<p>The reason I bring this up is I want to see if <a href="https://github.com/ruby/ruby/pull/4366" class="external">https://github.com/ruby/ruby/pull/4366</a> fixed this issue, but I can't reproduce the initial problem.</p> Ruby master - Bug #14090: `TestGc#test_interrupt_in_finalizer` fails very rarelyhttps://redmine.ruby-lang.org/issues/14090?journal_id=917162021-04-27T17:47:28Zxtkoba (Tee KOBAYASHI)
<ul></ul><p>This seems to be still a problem with a recent revision of Ruby on a recent GNU/Linux environment:</p>
<pre><code>Wed Apr 28 02:39:30 JST 2021
trial:3673
../revision.h unchanged
Run options:
--seed=50002
"--ruby=./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems"
--excludes-dir=../test/excludes
--name=!/memory_leak/
-n
test_interrupt_in_finalizer
# Running tests:
[1/1] TestGc#test_interrupt_in_finalizer = 11.03 s
1) Error:
TestGc#test_interrupt_in_finalizer:
Timeout::Error: execution of assert_in_out_err expired timeout (10 sec)
pid 7973 killed by SIGABRT (signal 6)
|
| -e: [BUG] Segmentation fault at 0x000003e800001f23
| ruby 3.1.0dev (2021-04-24T02:17:20Z master dee58d7ae7) [x86_64-linux]
| built with clang version 12.0.0
|
| -- Control frame information -----------------------------------------------
| c:0001 p:0000 s:0003 E:001140 (none) [FINISH]
|
|
| -- Machine register context ------------------------------------------------
| RIP: 0x00007fd50dfd13d6 RBP: 0x0000562211811fe0 RSP: 0x00007ffdd9599a40
| RAX: 0xfffffffffffffffc RBX: 0x0000562211812ce8 RCX: 0x00007fd50dfd13d6
| RDX: 0x0000000000000000 RDI: 0x00007ffdd9599aa0 RSI: 0x0000000000000002
| R8: 0x0000000000000008 R9: 0x0000000000000000 R10: 0x0000000000000000
| R11: 0x0000000000000293 R12: 0x0000000000000000 R13: 0x0000562211812cc0
| R14: 0x0000000000000000 R15: 0x0000562211811fe0 EFL: 0x0000000000000293
|
| -- C level backtrace information -------------------------------------------
/mnt/1TB/ruby.build/ruby-trunk-dee58d7/test/ruby/test_gc.rb:382:in `test_interrupt_in_finalizer'
Finished tests in 11.106566s, 0.0900 tests/s, 0.2701 assertions/s.
1 tests, 3 assertions, 0 failures, 1 errors, 0 skips
ruby -v: ruby 3.1.0dev (2021-04-24T02:17:20Z master dee58d7ae7) [x86_64-linux]
built with clang version 12.0.0
make: *** [uncommon.mk:802: yes-test-all] Error 1
</code></pre> Ruby master - Bug #14090: `TestGc#test_interrupt_in_finalizer` fails very rarelyhttps://redmine.ruby-lang.org/issues/14090?journal_id=917182021-04-27T17:56:38Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>xtkoba (Tee KOBAYASHI) wrote in <a href="#note-3">#note-3</a>:</p>
<blockquote>
<p>This seems to be still a problem with a recent revision of Ruby on a recent GNU/Linux environment:</p>
</blockquote>
<p><a class="user active user-mention" href="https://redmine.ruby-lang.org/users/48178">@xtkoba (Tee KOBAYASHI)</a> Thank you very much for testing. Are you able to check whether <a href="https://github.com/ruby/ruby/pull/4366" class="external">https://github.com/ruby/ruby/pull/4366</a> resolves the issue?</p> Ruby master - Bug #14090: `TestGc#test_interrupt_in_finalizer` fails very rarelyhttps://redmine.ruby-lang.org/issues/14090?journal_id=917212021-04-27T19:23:30Zxtkoba (Tee KOBAYASHI)
<ul></ul><p><a class="user active" href="https://redmine.ruby-lang.org/users/1604">jeremyevans0 (Jeremy Evans)</a> I tried the PR and it does not seem to resolve the intermittent timeout issue in <code>test_interrupt_in_finalizer</code> when the mitigation is disabled.</p> Ruby master - Bug #14090: `TestGc#test_interrupt_in_finalizer` fails very rarelyhttps://redmine.ruby-lang.org/issues/14090?journal_id=950492021-12-02T19:24:43Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>kosaki (Motohiro KOSAKI)</i> to <i>ko1 (Koichi Sasada)</i></li></ul>