https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112011-08-28T09:48:28ZRuby Issue Tracking SystemRuby master - Bug #5240: Hang when using threads + forks on Debian GNU/kFreeBSDhttps://redmine.ruby-lang.org/issues/5240?journal_id=204532011-08-28T09:48:28Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Target version</strong> set to <i>2.0.0</i></li></ul><p>Please send us an analysis and a patch.</p> Ruby master - Bug #5240: Hang when using threads + forks on Debian GNU/kFreeBSDhttps://redmine.ruby-lang.org/issues/5240?journal_id=204562011-08-28T15:11:06Zlucas (Lucas Nussbaum)lucas@lucas-nussbaum.net
<ul></ul><p>I'm sorry, I'm not familiar with that code at all.</p>
<p>What I can provide is a kfreebsd amd64 qemu image inside which it is easy to reproduce the problem (I used it to bisect).</p> Ruby master - Bug #5240: Hang when using threads + forks on Debian GNU/kFreeBSDhttps://redmine.ruby-lang.org/issues/5240?journal_id=204942011-08-30T15:08:48ZPetr.Salinger@seznam.cz (Petr Salinger)Petr.Salinger@seznam.cz
<ul><li><strong>File</strong> <a href="/attachments/2036">rb-th.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/2036/rb-th.diff">rb-th.diff</a> added</li><li><strong>File</strong> <a href="/attachments/2037">rb-main.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/2037/rb-main.diff">rb-main.diff</a> added</li></ul><p>I looked at the change and in general should work even for our slightly broken pthread semantic on GNU/kFreeBSD.<br>
It should be possible to workaround it by encapsulating timer_thread_pipe_owner_proces usage, as shown<br>
in first attached diff. We need to put somewhere during initialization</p>
<p>pthread_atfork(NULL, NULL, timer_thread_child_at_fork)</p>
<p>Even on fully conforming pthread implementation might be GNU/kFreeBSD variant better,<br>
as getpid() might be costly system call.</p>
<p>The problem is that place in main.c (as shown in 2nd diff) does not link.<br>
Please could you advice where to put this part of code. After that I would like to test it, whether it really works for us as expected.</p>
<p>Please advice me.</p> Ruby master - Bug #5240: Hang when using threads + forks on Debian GNU/kFreeBSDhttps://redmine.ruby-lang.org/issues/5240?journal_id=206912011-09-09T15:44:54Zlucas (Lucas Nussbaum)lucas@lucas-nussbaum.net
<ul></ul><p>Dear Ruby developers,</p>
<p>Could you comment on Petr Salinger's patch, and especially about where to put the pthread_atfork() call?</p>
<p>Thanks</p> Ruby master - Bug #5240: Hang when using threads + forks on Debian GNU/kFreeBSDhttps://redmine.ruby-lang.org/issues/5240?journal_id=206952011-09-09T17:07:43Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>ko1 (Koichi Sasada)</i></li></ul><p>sasada-san, could you please tell us your opinion?</p> Ruby master - Bug #5240: Hang when using threads + forks on Debian GNU/kFreeBSDhttps://redmine.ruby-lang.org/issues/5240?journal_id=207032011-09-10T00:23:13Zko1 (Koichi Sasada)
<ul><li><strong>ruby -v</strong> changed from <i>1.9.3</i> to <i>-</i></li></ul><p>Hi,</p>
<p>(2011/08/29 23:08), Petr Salinger wrote:</p>
<blockquote>
<p>The problem is that place in main.c (as shown in 2nd diff) does not link.<br>
Please could you advice where to put this part of code. After that I would like to test it, whether it really works for us as expected.</p>
<p>Please advice me.</p>
</blockquote>
<p>How about to add pthread_atfork() at rb_thread_create_timer_thread()?</p>
<p>--<br>
// SASADA Koichi at atdot dot net</p> Ruby master - Bug #5240: Hang when using threads + forks on Debian GNU/kFreeBSDhttps://redmine.ruby-lang.org/issues/5240?journal_id=339142012-11-26T09:23:29Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Feedback</i></li><li><strong>Target version</strong> changed from <i>2.0.0</i> to <i>2.6</i></li></ul> Ruby master - Bug #5240: Hang when using threads + forks on Debian GNU/kFreeBSDhttps://redmine.ruby-lang.org/issues/5240?journal_id=627732017-01-31T09:14:33Zko1 (Koichi Sasada)
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/62773/diff?detail_id=43823">diff</a>)</li><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>No discussion.</p>