https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2017-07-18T16:47:39Z
Ruby Issue Tracking System
Ruby master - Bug #13753: Segfault when calling `Random::DEFAULT.rand` in forked child
https://bugs.ruby-lang.org/issues/13753?journal_id=65840
2017-07-18T16:47:39Z
owst (Owen Stephens)
<ul><li><strong>File</strong> <a href="/attachments/6654">0001-Re-initialise-Random-DEFAULT-after-forking-Bug-13753.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6654/0001-Re-initialise-Random-DEFAULT-after-forking-Bug-13753.patch">0001-Re-initialise-Random-DEFAULT-after-forking-Bug-13753.patch</a> added</li></ul><p>The attached patch fixes the issue by re-initialising the random instance such that calls to <code>Random::DEFAULT.rand</code> after forking will succeed.</p>
<p>This now gives the same after-fork behaviour as <code>Random.rand</code>. Incidentally, there is a comment on <code>Random.rand</code> saying:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"> <span class="o">*</span> <span class="no">Alias</span> <span class="n">of</span> <span class="no">Random</span><span class="o">::</span><span class="no">DEFAULT</span><span class="p">.</span><span class="nf">rand</span><span class="o">.</span>
</code></pre>
<p>which is now true in the sense that they behave the same.</p>
Ruby master - Bug #13753: Segfault when calling `Random::DEFAULT.rand` in forked child
https://bugs.ruby-lang.org/issues/13753?journal_id=65842
2017-07-19T03:17:03Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset trunk|r59368.</p>
<hr>
<p>random.c: ensure initialized</p>
<ul>
<li>random.c (get_rnd, try_get_rnd): ensure initialized to get rid<br>
of crash in forked processes. <a href="/issues/13753">[ruby-core:82100]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Segfault when calling `Random::DEFAULT.rand` in forked child (Closed)" href="https://bugs.ruby-lang.org/issues/13753">#13753</a>]</li>
</ul>
Ruby master - Bug #13753: Segfault when calling `Random::DEFAULT.rand` in forked child
https://bugs.ruby-lang.org/issues/13753?journal_id=65843
2017-07-19T03:24:31Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Backport</strong> changed from <i>2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN</i> to <i>2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED</i></li></ul>
Ruby master - Bug #13753: Segfault when calling `Random::DEFAULT.rand` in forked child
https://bugs.ruby-lang.org/issues/13753?journal_id=66036
2017-08-05T06:46:27Z
nagachika (Tomoyuki Chikanaga)
nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED</i> to <i>2.2: REQUIRED, 2.3: REQUIRED, 2.4: DONE</i></li></ul><p>ruby_2_4 r59517 merged revision(s) 59368.</p>
Ruby master - Bug #13753: Segfault when calling `Random::DEFAULT.rand` in forked child
https://bugs.ruby-lang.org/issues/13753?journal_id=66097
2017-08-09T10:32:40Z
usa (Usaku NAKAMURA)
usa@garbagecollect.jp
<ul><li><strong>Backport</strong> changed from <i>2.2: REQUIRED, 2.3: REQUIRED, 2.4: DONE</i> to <i>2.2: REQUIRED, 2.3: DONE, 2.4: DONE</i></li></ul><p>ruby_2_3 r59546 merged revision(s) 59368.</p>