ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:88578] [Ruby trunk Bug#15013] thread_pthread.c: reinitialize ubf_list at fork
       [not found] <redmine.issue-15013.20180820210124@ruby-lang.org>
@ 2018-08-20 21:01 ` normalperson
  2019-03-12 23:59 ` [ruby-core:91802] " nagachika00
  1 sibling, 0 replies; 2+ messages in thread
From: normalperson @ 2018-08-20 21:01 UTC (permalink / raw)
  To: ruby-core

Issue #15013 has been reported by normalperson (Eric Wong).

----------------------------------------
Bug #15013: thread_pthread.c: reinitialize ubf_list at fork
https://bugs.ruby-lang.org/issues/15013

* Author: normalperson (Eric Wong)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED
----------------------------------------
thread_pthread.c: reinitialize ubf_list at fork

It's possible for the ubf_list_head to be populated with dead
threads at fork or the ubf_list_lock to be held, so reinitialize
both at startup.

And while we're at it, use a static initializer at startup
to save a library call and kill some ifdef.


---Files--------------------------------
0001-thread_pthread.c-reinitialize-ubf_list-at-fork.patch (2.46 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:91802] [Ruby trunk Bug#15013] thread_pthread.c: reinitialize ubf_list at fork
       [not found] <redmine.issue-15013.20180820210124@ruby-lang.org>
  2018-08-20 21:01 ` [ruby-core:88578] [Ruby trunk Bug#15013] thread_pthread.c: reinitialize ubf_list at fork normalperson
@ 2019-03-12 23:59 ` nagachika00
  1 sibling, 0 replies; 2+ messages in thread
From: nagachika00 @ 2019-03-12 23:59 UTC (permalink / raw)
  To: ruby-core

Issue #15013 has been updated by nagachika (Tomoyuki Chikanaga).


MEMO: backporting r64485 and r64635 cause some make test failures on my environment.
I give up to fix these for just now.

```
#257 test_fork.rb:31:in `<top (required)>':
     begin
       r, w = IO.pipe
       if pid1 = fork
         w.close
         r.read(1)
         Process.kill("USR1", pid1)
         _, s = Process.wait2(pid1)
         s.success? ? :ok : :ng
       else
         r.close
         if pid2 = fork
           trap("USR1") { Time.now.to_s; Process.kill("USR2", pid2) }
           w.close
           Process.wait2(pid2)
         else
           w.close
           sleep 0.2
         end
         exit true
       end
     rescue NotImplementedError
       :ok
     end
  #=> "ng" (expected "ok")  [ruby-core:28924]
stderr output is not empty
   bootstraptest.tmp.rb:13:in `kill': No such process (Errno::ESRCH)
           from bootstraptest.tmp.rb:13:in `block in <main>'
           from bootstraptest.tmp.rb:15:in `wait2'
           from bootstraptest.tmp.rb:15:in `<main>'
test_fork.rb            FAIL 1/5
#455 test_io.rb:87:in `block in <top (required)>':
       at_exit { p :foo }

       megacontent = "abc" * 12345678
       #File.open("megasrc", "w") {|f| f << megacontent }

       t0 = Thread.main
       Thread.new { sleep 0.001 until t0.stop?; Process.kill(:INT, $$) }

       r1, w1 = IO.pipe
       r2, w2 = IO.pipe
       t1 = Thread.new { w1 << megacontent; w1.close }
       t2 = Thread.new { r2.read; r2.close }
       IO.copy_stream(r1, w2) rescue nil
       w2.close
       r1.close
       t1.join
       t2.join
  #=> killed by SIGKILL (signal 9) (timeout)  megacontent-copy_stream
test_io.rb              FAIL 1/9
FAIL 2/1201 tests failed
```

----------------------------------------
Bug #15013: thread_pthread.c: reinitialize ubf_list at fork
https://bugs.ruby-lang.org/issues/15013#change-77075

* Author: normalperson (Eric Wong)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED
----------------------------------------
thread_pthread.c: reinitialize ubf_list at fork

It's possible for the ubf_list_head to be populated with dead
threads at fork or the ubf_list_lock to be held, so reinitialize
both at startup.

And while we're at it, use a static initializer at startup
to save a library call and kill some ifdef.


---Files--------------------------------
0001-thread_pthread.c-reinitialize-ubf_list-at-fork.patch (2.46 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-13  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15013.20180820210124@ruby-lang.org>
2018-08-20 21:01 ` [ruby-core:88578] [Ruby trunk Bug#15013] thread_pthread.c: reinitialize ubf_list at fork normalperson
2019-03-12 23:59 ` [ruby-core:91802] " nagachika00

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).