https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2015-01-01T00:14:15Z
Ruby Issue Tracking System
Ruby master - Bug #10685: Segfault from keyword rest arg when coercing an object that defines to_hash
https://bugs.ruby-lang.org/issues/10685?journal_id=50733
2015-01-01T00:14:15Z
chrisseaton (Chris Seaton)
chris@chrisseaton.com
<ul></ul><p>I think this is the equivalent code extracted from MSpec. But I can't get this to crash on 2.2.0p0.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">m</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="k">yield</span> <span class="n">a</span> <span class="k">end</span>
<span class="k">class</span> <span class="nc">Mock</span>
<span class="k">def</span> <span class="nf">to_hash</span>
<span class="nb">puts</span> <span class="s1">'to_hash called'</span>
<span class="p">{</span><span class="ss">x: </span><span class="mi">9</span><span class="p">}</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">obj</span> <span class="o">=</span> <span class="no">Mock</span><span class="p">.</span><span class="nf">new</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">m</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="n">obj</span><span class="p">])</span> <span class="p">{</span> <span class="o">|</span><span class="n">a</span><span class="p">,</span> <span class="o">*</span><span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="o">**</span><span class="n">k</span><span class="o">|</span> <span class="p">[</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">k</span><span class="p">]</span> <span class="p">}</span>
<span class="nb">p</span> <span class="n">result</span><span class="c1">#.should == [1, [2], 3, {x: 9}]</span>
<span class="nb">p</span> <span class="n">result</span> <span class="o">==</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="mi">3</span><span class="p">,</span> <span class="p">{</span><span class="ss">x: </span><span class="mi">9</span><span class="p">}]</span>
</code></pre>
Ruby master - Bug #10685: Segfault from keyword rest arg when coercing an object that defines to_hash
https://bugs.ruby-lang.org/issues/10685?journal_id=50735
2015-01-01T00:38:34Z
normalperson (Eric Wong)
normalperson@yhbt.net
<ul></ul><p>Thanks for the report, looks like nobu committed a fix as r49088</p>
<blockquote>
<p>This spec appears to cause the segfault mentioned in<br>
<a href="http://rubini.us/2014/12/31/matz-s-ruby-developers-don-t-use-rubyspec/" class="external">http://rubini.us/2014/12/31/matz-s-ruby-developers-don-t-use-rubyspec/</a><br>
today.</p>
</blockquote>
<p>Fwiw, I do run "make test-rubyspec" before I commit,<br>
but that's naruse's repo which I guess is different..</p>
<p>Like many projects nowadays, I won't bother contributing to rubyspec<br>
because it requires an account on a proprietary service provider.<br>
Free Software (e.g. Ruby) needs Free tools:<br>
<a href="http://mako.cc/writing/hill-free_tools.html" class="external">http://mako.cc/writing/hill-free_tools.html</a></p>
Ruby master - Bug #10685: Segfault from keyword rest arg when coercing an object that defines to_hash
https://bugs.ruby-lang.org/issues/10685?journal_id=50737
2015-01-01T01:20:16Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset r49089.</p>
<hr>
<p>vm_args.c: add ref r49088</p>
<ul>
<li>vm_args.c (keyword_hash_p): fix non-symbol keys hash.<br>
rb_extract_keywords() returns 0 not Qnil when no symbol keys is<br>
included. <a href="/issues/10685">[ruby-core:67264]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Segfault from keyword rest arg when coercing an object that defines to_hash (Closed)" href="https://bugs.ruby-lang.org/issues/10685">#10685</a>]</li>
</ul>
Ruby master - Bug #10685: Segfault from keyword rest arg when coercing an object that defines to_hash
https://bugs.ruby-lang.org/issues/10685?journal_id=50739
2015-01-01T01:25:44Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/50739/diff?detail_id=36481">diff</a>)</li><li><strong>Backport</strong> changed from <i>2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN</i> to <i>2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED</i></li></ul>
Ruby master - Bug #10685: Segfault from keyword rest arg when coercing an object that defines to_hash
https://bugs.ruby-lang.org/issues/10685?journal_id=50740
2015-01-01T01:27:49Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul></ul><p>Chris Seaton wrote:</p>
<blockquote>
<p>I think this is the equivalent code extracted from MSpec. But I can't get this to crash on 2.2.0p0.</p>
</blockquote>
<p>It's another failure, but false positive.</p>
Ruby master - Bug #10685: Segfault from keyword rest arg when coercing an object that defines to_hash
https://bugs.ruby-lang.org/issues/10685?journal_id=50788
2015-01-04T16:11:24Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/10695">Bug #10695</a>: Segmentation fault with *args and **kwargs</i> added</li></ul>
Ruby master - Bug #10685: Segfault from keyword rest arg when coercing an object that defines to_hash
https://bugs.ruby-lang.org/issues/10685?journal_id=50961
2015-01-12T14:33:35Z
ktsj (Kazuki Tsujimoto)
kazuki@callcc.net
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/10734">Bug #10734</a>: Segfault when combining default arguments with keyword arguments</i> added</li></ul>
Ruby master - Bug #10685: Segfault from keyword rest arg when coercing an object that defines to_hash
https://bugs.ruby-lang.org/issues/10685?journal_id=51040
2015-01-16T05:19:40Z
naruse (Yui NARUSE)
naruse@airemix.jp
<ul><li><strong>Backport</strong> changed from <i>2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED</i> to <i>2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE</i></li></ul><p>ruby_2_2 r49272 merged revision(s) 49089.</p>