From: Motohiro KOSAKI Date: 2010-12-22T19:10:57+09:00 Subject: [ruby-dev:42858] [Ruby 1.9-Bug#4121] test_getpty_nonexistentで止まることがある チケット #4121 が更新されました。 (by Motohiro KOSAKI) 誰が悪いのかはわかりませんが、以下の2つのコミットが間違っていることと、現在のtrunkだと fork時に子プロセスがGVLを再初期化するまえにGVLをacquireするケースがあるので、forkが動くのは ただのミラクルということが分かりました。 あと、Process#fork()以外のfork(IO#popenとか)だとrb_thread_atforkが呼ばれてないので、 消滅したスレッドの掃除もされないし、GVLも再初期化されませんが、これもたぶんバグです。 たぶん直せそうな気がするのでクリスマス中にでもやっときます。 詳細なレポートをくれた、Chikanagaさんには感謝いっぱいです。 ---------------------------------------------------------------------------------------------- commit f54418b71f57e00d4a50bd86bf7d18b8b5195287 Author: matz Date: Mon Nov 27 09:23:38 2000 +0000 matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1053 b2dd03c8-39d4-4d8f-98ff-823fe69 +Mon Nov 27 00:10:08 2000 Yukihiro Matsumoto + + * io.c (rb_io_ctl): call ioctl/fcntl for fptr->f2 too. + + * process.c (rb_f_fork): call rb_thread_atfork() after creating + child process. + + * eval.c (rb_thread_atfork): kill all other threads immediately, + then turn the current thread into the main thread. + ---------------------------------------------------------------------------------------------- commit e4cf9c59fda102a80aa767c3a66a4738e26f6213 Author: ko1 Date: Sun Nov 28 13:00:49 2010 +0000 * thread_pthread.c: remove pthread_atfork(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29963 b2dd03c8-39d4-4d8f-98ff-823fe6 ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4121 ---------------------------------------- http://redmine.ruby-lang.org