https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2013-12-29T00:38:18Z
Ruby Issue Tracking System
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=43931
2013-12-29T00:38:18Z
mame (Yusuke Endoh)
mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>nobu (Nobuyoshi Nakada)</i></li></ul><p>Good catch. Here is a smaller example:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">module</span> <span class="nn">A</span>
<span class="k">def</span> <span class="nf">foo</span>
<span class="k">super</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">class</span> <span class="nc">B</span>
<span class="kp">include</span> <span class="no">A</span>
<span class="k">end</span>
<span class="no">B</span><span class="p">.</span><span class="nf">new</span><span class="p">.</span><span class="nf">method</span><span class="p">(</span><span class="ss">:foo</span><span class="p">).</span><span class="nf">call</span>
</code></pre>
<p>I think r44179 caused this issue.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=43934
2013-12-29T08:21:19Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r44455.<br>
Jan, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>vm_insnhelper.c: missing super in method module</p>
<ul>
<li>vm_insnhelper.c (<code>vm_search_super_method</code>): direct superclass of a<br>
module is found when super called in a Method object generated a<br>
method defined in a module, call <code>method_missing</code> in that case.<br>
<a href="/issues/9315">[ruby-core:59358]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Segfault when calling super in rspec mocks with and_call_original [linux] (Closed)" href="https://bugs.ruby-lang.org/issues/9315">#9315</a>]</li>
</ul>
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=43942
2013-12-30T00:55:00Z
nagachika (Tomoyuki Chikanaga)
nagachika00@gmail.com
<ul></ul><p>Hello,</p>
<p>r44175 and r44179 were already backported to ruby_2_0_0 branch at r44345.<br>
But I cannot reproduce SEGV on 2.0.0-head(r44393) with testcase in r44455.<br>
I wonder if I should backport r44458 to ruby_2_0_0. Any idea?</p>
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=44120
2014-01-06T20:04:50Z
jgraichen (Jan Graichen)
jgraichen@altimos.de
<ul></ul><p>I've finally had time to test my test suite on current ruby heads and encountered some other similar problems again.</p>
<p>Given the following example:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">module</span> <span class="nn">Persistence</span>
<span class="k">def</span> <span class="nf">save!</span>
<span class="c1"># save to disk etc.</span>
<span class="nb">puts</span> <span class="s2">"saved!"</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">module</span> <span class="nn">Validation</span>
<span class="k">def</span> <span class="nf">valid?</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
<span class="kp">true</span>
<span class="k">end</span>
<span class="c1"># Hook save!</span>
<span class="k">def</span> <span class="nf">save!</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">)</span>
<span class="k">return</span> <span class="kp">false</span> <span class="k">unless</span> <span class="n">valid?</span> <span class="ss">:create</span>
<span class="k">super</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">class</span> <span class="nc">Model</span>
<span class="kp">include</span> <span class="no">Persistence</span>
<span class="kp">include</span> <span class="no">Validation</span>
<span class="k">end</span>
<span class="no">Model</span><span class="p">.</span><span class="nf">new</span><span class="p">.</span><span class="nf">method</span><span class="p">(</span><span class="ss">:save!</span><span class="p">).</span><span class="nf">call</span>
</code></pre>
<p>On <code>ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]</code>:</p>
<pre><code>> ruby test.rb
saved!
</code></pre>
<p>On <code>ruby 2.0.0p377 (2014-01-03 revision 44491) [x86_64-linux]</code>:</p>
<pre><code>> ruby test.rb
test.rb:16:in `save!': super: no superclass method `save!' for #<Model:0x00000000dccc88> (NoMethodError)
from test.rb:25:in `call'
from test.rb:25:in `<main>'
</code></pre>
<p>And on <code>ruby 2.1.1p2 (2013-12-31 revision 44467) [x86_64-linux]</code>:</p>
<pre><code>> ruby test.rb
test.rb:16: [BUG] Segmentation fault at 0x00000000000018
ruby 2.1.1p2 (2013-12-31 revision 44467) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0004 p:0026 s:0012 e:000010 METHOD test.rb:16 [FINISH]
c:0003 p:---- s:0007 e:000006 CFUNC :call
c:0002 p:0047 s:0004 E:001ca8 EVAL test.rb:25 [FINISH]
c:0001 p:0000 s:0002 E:001978 TOP [FINISH]
-- Ruby level backtrace information ----------------------------------------
test.rb:25:in `<main>'
test.rb:25:in `call'
test.rb:16:in `save!'
-- C level backtrace information -------------------------------------------
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1e18ec) [0x7f40e25dd8ec] vm_dump.c:685
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x76d43) [0x7f40e2472d43] error.c:307
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(rb_bug+0xb3) [0x7f40e2473993] error.c:334
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1595ce) [0x7f40e25555ce] signal.c:704
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf210) [0x7f40e21ef210]
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1cba03) [0x7f40e25c7a03] vm_method.c:573
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1cfe79) [0x7f40e25cbe79] vm_insnhelper.c:2029
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1d393c) [0x7f40e25cf93c] vm.c:1304
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1d47f4) [0x7f40e25d07f4] vm_eval.c:171
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1d5477) [0x7f40e25d1477] vm_eval.c:50
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(rb_method_call_with_block+0x10a) [0x7f40e248456a] proc.c:1833
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1d7e41) [0x7f40e25d3e41] vm_insnhelper.c:1470
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1cfd54) [0x7f40e25cbd54] insns.def:1028
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x1d393c) [0x7f40e25cf93c] vm.c:1304
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(rb_iseq_eval_main+0x1f6) [0x7f40e25d8986] vm.c:1562
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(+0x7ceea) [0x7f40e2478eea] eval.c:253
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(ruby_exec_node+0x1d) [0x7f40e247ae7d] eval.c:318
/home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1(ruby_run_node+0x1c) [0x7f40e247d2bc] eval.c:310
ruby() [0x40088b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f40e171c995]
ruby() [0x4008b9]
-- Other runtime information -----------------------------------------------
* Loaded script: test.rb
* Loaded features:
0 enumerator.so
1 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/enc/encdb.so
2 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/enc/trans/transdb.so
3 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/rbconfig.rb
4 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/compatibility.rb
5 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/defaults.rb
6 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/deprecate.rb
7 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/errors.rb
8 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/version.rb
9 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/requirement.rb
10 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/platform.rb
11 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/basic_specification.rb
12 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/stub_specification.rb
13 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/util/stringio.rb
14 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb
15 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/exceptions.rb
16 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb
17 thread.rb
18 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/thread.so
19 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/monitor.rb
20 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb
21 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/site_ruby/2.1.0/rubygems.rb
* Process memory map:
00400000-00401000 r-xp 00000000 fe:03 17045008 /home/jan/.rvm/rubies/ruby-2.1.0-head/bin/ruby
00600000-00601000 rw-p 00000000 fe:03 17045008 /home/jan/.rvm/rubies/ruby-2.1.0-head/bin/ruby
019d1000-01e6a000 rw-p 00000000 00:00 0 [heap]
7f40e0be4000-7f40e0bf9000 r-xp 00000000 fe:02 1966585 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f40e0bf9000-7f40e0df9000 ---p 00015000 fe:02 1966585 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f40e0df9000-7f40e0dfa000 rw-p 00015000 fe:02 1966585 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f40e0dfa000-7f40e0dfd000 r-xp 00000000 fe:03 17045821 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/thread.so
7f40e0dfd000-7f40e0ffc000 ---p 00003000 fe:03 17045821 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/thread.so
7f40e0ffc000-7f40e0ffd000 rw-p 00002000 fe:03 17045821 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/thread.so
7f40e0ffd000-7f40e0fff000 r-xp 00000000 fe:03 17045808 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/enc/trans/transdb.so
7f40e0fff000-7f40e11ff000 ---p 00002000 fe:03 17045808 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/enc/trans/transdb.so
7f40e11ff000-7f40e1200000 rw-p 00002000 fe:03 17045808 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/enc/trans/transdb.so
7f40e1200000-7f40e1202000 r-xp 00000000 fe:03 17045760 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/enc/encdb.so
7f40e1202000-7f40e1401000 ---p 00002000 fe:03 17045760 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/enc/encdb.so
7f40e1401000-7f40e1402000 rw-p 00001000 fe:03 17045760 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/ruby/2.1.0/x86_64-linux/enc/encdb.so
7f40e1402000-7f40e16fb000 r--p 00000000 fe:02 551553 /usr/lib/locale/locale-archive
7f40e16fb000-7f40e189e000 r-xp 00000000 fe:02 1966939 /lib/x86_64-linux-gnu/libc-2.17.so
7f40e189e000-7f40e1a9d000 ---p 001a3000 fe:02 1966939 /lib/x86_64-linux-gnu/libc-2.17.so
7f40e1a9d000-7f40e1aa1000 r--p 001a2000 fe:02 1966939 /lib/x86_64-linux-gnu/libc-2.17.so
7f40e1aa1000-7f40e1aa3000 rw-p 001a6000 fe:02 1966939 /lib/x86_64-linux-gnu/libc-2.17.so
7f40e1aa3000-7f40e1aa7000 rw-p 00000000 00:00 0
7f40e1aa7000-7f40e1ba3000 r-xp 00000000 fe:02 1966949 /lib/x86_64-linux-gnu/libm-2.17.so
7f40e1ba3000-7f40e1da3000 ---p 000fc000 fe:02 1966949 /lib/x86_64-linux-gnu/libm-2.17.so
7f40e1da3000-7f40e1da4000 r--p 000fc000 fe:02 1966949 /lib/x86_64-linux-gnu/libm-2.17.so
7f40e1da4000-7f40e1da5000 rw-p 000fd000 fe:02 1966949 /lib/x86_64-linux-gnu/libm-2.17.so
7f40e1da5000-7f40e1dad000 r-xp 00000000 fe:02 1966946 /lib/x86_64-linux-gnu/libcrypt-2.17.so
7f40e1dad000-7f40e1fac000 ---p 00008000 fe:02 1966946 /lib/x86_64-linux-gnu/libcrypt-2.17.so
7f40e1fac000-7f40e1fad000 r--p 00007000 fe:02 1966946 /lib/x86_64-linux-gnu/libcrypt-2.17.so
7f40e1fad000-7f40e1fae000 rw-p 00008000 fe:02 1966946 /lib/x86_64-linux-gnu/libcrypt-2.17.so
7f40e1fae000-7f40e1fdc000 rw-p 00000000 00:00 0
7f40e1fdc000-7f40e1fdf000 r-xp 00000000 fe:02 1966937 /lib/x86_64-linux-gnu/libdl-2.17.so
7f40e1fdf000-7f40e21de000 ---p 00003000 fe:02 1966937 /lib/x86_64-linux-gnu/libdl-2.17.so
7f40e21de000-7f40e21df000 r--p 00002000 fe:02 1966937 /lib/x86_64-linux-gnu/libdl-2.17.so
7f40e21df000-7f40e21e0000 rw-p 00003000 fe:02 1966937 /lib/x86_64-linux-gnu/libdl-2.17.so
7f40e21e0000-7f40e21f7000 r-xp 00000000 fe:02 1966931 /lib/x86_64-linux-gnu/libpthread-2.17.so
7f40e21f7000-7f40e23f6000 ---p 00017000 fe:02 1966931 /lib/x86_64-linux-gnu/libpthread-2.17.so
7f40e23f6000-7f40e23f7000 r--p 00016000 fe:02 1966931 /lib/x86_64-linux-gnu/libpthread-2.17.so
7f40e23f7000-7f40e23f8000 rw-p 00017000 fe:02 1966931 /lib/x86_64-linux-gnu/libpthread-2.17.so
7f40e23f8000-7f40e23fc000 rw-p 00000000 00:00 0
7f40e23fc000-7f40e26a7000 r-xp 00000000 fe:03 17045009 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1.0
7f40e26a7000-7f40e28a7000 ---p 002ab000 fe:03 17045009 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1.0
7f40e28a7000-7f40e28af000 rw-p 002ab000 fe:03 17045009 /home/jan/.rvm/rubies/ruby-2.1.0-head/lib/libruby.so.2.1.0
7f40e28af000-7f40e28d5000 rw-p 00000000 00:00 0
7f40e28d5000-7f40e28f6000 r-xp 00000000 fe:02 1966711 /lib/x86_64-linux-gnu/ld-2.17.so
7f40e29c2000-7f40e2ac8000 rw-p 00000000 00:00 0
7f40e2aef000-7f40e2af0000 rw-p 00000000 00:00 0
7f40e2af0000-7f40e2af1000 ---p 00000000 00:00 0
7f40e2af1000-7f40e2af6000 rw-p 00000000 00:00 0 [stack:26115]
7f40e2af6000-7f40e2af7000 r--p 00021000 fe:02 1966711 /lib/x86_64-linux-gnu/ld-2.17.so
7f40e2af7000-7f40e2af9000 rw-p 00022000 fe:02 1966711 /lib/x86_64-linux-gnu/ld-2.17.so
7fffd4700000-7fffd4721000 rw-p 00000000 00:00 0
7fffd47fe000-7fffd4800000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Aborted
</code></pre>
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=44121
2014-01-06T22:00:01Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul></ul><p>Seems working on the trunk.</p>
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=44126
2014-01-07T00:36:27Z
jgraichen (Jan Graichen)
jgraichen@altimos.de
<ul></ul><p>Yes, <code>ruby 2.2.0dev (2014-01-06 trunk 44510) [x86_64-linux]</code> indeed works. Looks somehow I missed the most important head. Sorry.</p>
<p>At least the error on current 2.0.0-head seems interesting, should I open another bug for it?</p>
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=44127
2014-01-07T00:49:28Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Backport</strong> changed from <i>1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN</i> to <i>1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1.0: REQUIRED</i></li></ul><p>r44458 fixed it.<br>
Now I filled the Backport property, it will be backported.</p>
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=44129
2014-01-07T01:37:28Z
nagachika (Tomoyuki Chikanaga)
nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1.0: REQUIRED</i> to <i>1.9.3: DONTNEED, 2.0.0: DONE, 2.1.0: REQUIRED</i></li></ul><p>Hello,<br>
Jan, thank you for your investigation!</p>
<p>r44455, r44458 and r44510 were backported to <code>ruby_2_0_0</code> branch at r44511.<br>
Thanks again.</p>
Ruby master - Bug #9315: Segfault when calling super in rspec mocks with and_call_original [linux]
https://bugs.ruby-lang.org/issues/9315?journal_id=44212
2014-01-11T02:19:00Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Is duplicate of</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/9309">Bug #9309</a>: Crash while running tests</i> added</li></ul>