https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112010-05-27T16:08:52ZRuby Issue Tracking SystemRuby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=112792010-05-27T16:08:52Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>3</i></li></ul><p>I thought I had submitted that bug, actually, but seems I forgot!</p>
<p>Just to clarify: this happens when a module appears twice in the list of ancestors. Ruby typically forbids this, but if the module is included in just the right order, it is possible. In the example given, invert the two includes and Override is included only once.</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=113192010-05-29T04:21:39Zserge_balyuk (Serge Balyuk)serge@complicated-simplicity.com
<ul></ul><p>Hi Marc-Andre,</p>
<p>Yes, exactly. Very rare situation. This is the simplified version of include sequence that I observed in one specific rails/rspec use case. And with inverted includes everything works like charm.</p>
<p>Thanks</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=182912011-06-26T14:58:06Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>ko1 (Koichi Sasada)</i></li><li><strong>Target version</strong> changed from <i>2.0.0</i> to <i>1.9.3</i></li></ul> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=186382011-06-28T23:28:49Zfunny_falcon (Yura Sokolov)funny.falcon@gmail.com
<ul></ul><p>I had catched by this with rails/sequel/custom backend for delayed_jobs.<br>
After figuring, I ought to do some manipulations with requiring my initializators, and that looks ugly a bit.</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=190162011-07-10T14:28:29Zko1 (Koichi Sasada)
<ul><li><strong>Target version</strong> changed from <i>1.9.3</i> to <i>2.0.0</i></li></ul><p>I'll challenge this issue on 1.9.4. Sorry.</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=286212012-08-03T19:27:23Zshugo (Shugo Maeda)
<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 r36612.<br>
Serge, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>insns.def (invokesuper): don't skip the same class. instead, use<br>
rb_method_entry_get_with_omod() to avoid infinite loop when<br>
super is used with refinements. <a href="/issues/3351">[ruby-core:30450]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: stack overflow on super (Closed)" href="https://redmine.ruby-lang.org/issues/3351">#3351</a>]</li>
</ul> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=286302012-08-04T01:35:02Zshugo (Shugo Maeda)
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Open</i></li></ul><p>In HEAD of trunk, stack overflow doesn't occur, but Override#foo is called only once.<br>
So I reopen this ticket.</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=340832012-11-28T22:35:12Zko1 (Koichi Sasada)
<ul></ul><p>shugo-san, do you know why Override#foo called only once?</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=345632012-12-10T00:28:55Zmame (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> changed from <i>ko1 (Koichi Sasada)</i> to <i>shugo (Shugo Maeda)</i></li></ul><p>Shugo-san, ko1, what's the status?<br>
Do you think this issue important?</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=346902012-12-13T14:24:21Zshugo (Shugo Maeda)
<ul><li><strong>Assignee</strong> changed from <i>shugo (Shugo Maeda)</i> to <i>matz (Yukihiro Matsumoto)</i></li></ul><p>mame (Yusuke Endoh) wrote:</p>
<blockquote>
<p>Shugo-san, ko1, what's the status?</p>
</blockquote>
<p>Override#foo is called only once, because in the SVN trunk, if a method found by super is the current method, it's skipped to avoid an infinite loop. The check was introduced for super in a refinement. Without it, super in a refinement causes an infinite loop.</p>
<blockquote>
<p>Do you think this issue important?</p>
</blockquote>
<p>I don't think so. Can I leave it as is, Matz?</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=346932012-12-13T14:53:16ZAnonymous
<ul></ul><p>Hi,</p>
<p>In message "Re: <a href="/issues/3351">[ruby-core:50857]</a> [ruby-trunk - Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: stack overflow on super (Closed)" href="https://redmine.ruby-lang.org/issues/3351">#3351</a>] stack overflow on super"<br>
on Thu, 13 Dec 2012 14:24:21 +0900, "shugo (Shugo Maeda)" <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> writes:</p>
<blockquote>
<blockquote>
<p>Do you think this issue important?</p>
</blockquote>
<p>I don't think so. Can I leave it as is, Matz?</p>
</blockquote>
<p>OK.</p>
<pre><code> matz.
</code></pre> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=351422012-12-29T22:03:24Zshugo (Shugo Maeda)
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Open</i></li><li><strong>Assignee</strong> deleted (<del><i>matz (Yukihiro Matsumoto)</i></del>)</li><li><strong>Target version</strong> changed from <i>2.0.0</i> to <i>2.6</i></li></ul> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=364592013-02-18T08:49:30Zko1 (Koichi Sasada)
<ul><li><strong>Assignee</strong> set to <i>ko1 (Koichi Sasada)</i></li></ul> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=532242015-07-01T09:11:58Zko1 (Koichi Sasada)
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/53224/diff?detail_id=38329">diff</a>)</li></ul> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=532252015-07-01T09:27:39Zko1 (Koichi Sasada)
<ul></ul><p>Just now, we avoid this issue by putting <code>klass</code> into each frame.</p>
<p>However, the workaround is remaining.</p>
<p>Now, ancestors is here:</p>
<pre><code>[B, Override, A, Override, Base, Object, Kernel, BasicObject]
</code></pre>
<p>and now MRI calls <code>Override#foo</code> only once. It skips second Override#foo.</p>
<pre><code>override
bar
</code></pre>
<p>However, if there is a <code>A#foo</code>, then call <code>Override#foo</code> twice.</p>
<pre><code>override
A
override
bar
</code></pre>
<p>It is ugly workaround. So I want to remove such skipping.</p>
<p>Matz: Can I call <code>Override#foo</code> twice even if it is duplicated with last call?</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=532962015-07-06T08:38:04Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>Agreed.</p>
<p>Matz.</p> Ruby master - Bug #3351: stack overflow on superhttps://redmine.ruby-lang.org/issues/3351?journal_id=532972015-07-06T09:03:01Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset r51161.</p>
<hr>
<ul>
<li>vm_insnhelper.c (vm_search_super_method): do not skip calling<br>
same methods in super.<br>
[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: stack overflow on super (Closed)" href="https://redmine.ruby-lang.org/issues/3351">#3351</a>]</li>
<li>test/ruby/test_super.rb: fix a test.</li>
</ul>