https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112008-08-28T15:58:53ZRuby Issue Tracking SystemBackport187 - Backport #146: Incorrect line numbers in "caller" output when evaluated in a Proc bindinghttps://redmine.ruby-lang.org/issues/146?journal_id=9382008-08-28T15:58:53Zwilson (Wilson Bilkovich)wilson@supremetyrant.com
<ul></ul><p>=begin<br>
Everybody agrees that this is a bug, right?<br>
=end</p> Backport187 - Backport #146: Incorrect line numbers in "caller" output when evaluated in a Proc bindinghttps://redmine.ruby-lang.org/issues/146?journal_id=30312009-02-03T12:55:39Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Assignee</strong> set to <i>matz (Yukihiro Matsumoto)</i></li></ul><p>=begin</p>
<p>=end</p> Backport187 - Backport #146: Incorrect line numbers in "caller" output when evaluated in a Proc bindinghttps://redmine.ruby-lang.org/issues/146?journal_id=45292009-07-08T21:55:28Zrunpaint (Run Paint Run Run)runrun@runpaint.org
<ul></ul><p>=begin<br>
On 1.9 trunk:</p>
<pre><code> ["(eval):1:in `second'", "/tmp/proc_caller.rb:16:in `eval'", "/tmp/proc_caller.rb:16:in `<main>'"]
</code></pre>
<p>(I'm trying to understand the changes in <code>caller</code> output between 1.8 and 1.9 and failing).<br>
=end</p> Backport187 - Backport #146: Incorrect line numbers in "caller" output when evaluated in a Proc bindinghttps://redmine.ruby-lang.org/issues/146?journal_id=58082009-09-15T02:31:21Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>ruby -v</strong> set to <i>-</i></li></ul><p>=begin<br>
The expected output should be the same for<br>
eval("p caller(0)", first.binding)<br>
and<br>
eval("p caller(0)", second.binding)<br>
since the block has the same binding (i.e. that of second).</p>
<p>At the moment "p caller" is evaluated, both first and second have returned, so the output should not contain "proc_caller.rb:6". In neither case should we expect to see "proc_caller.rb:2:in `first'" in the backtrace.</p>
<p>It appears that when a block is captured (here by third), the binding is set the the full stack instead of just that of second. This leads to a longer backtrace, as seen with the output of caller or if an exception is raised in the eval.</p>
<p>Just to confirm that this bug is not present in Ruby 1.9; the output is quite sensible and the same from both first.binding and second.binding.<br>
=end</p> Backport187 - Backport #146: Incorrect line numbers in "caller" output when evaluated in a Proc bindinghttps://redmine.ruby-lang.org/issues/146?journal_id=134192010-09-14T17:04:08Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul><p>=begin</p>
<p>=end</p> Backport187 - Backport #146: Incorrect line numbers in "caller" output when evaluated in a Proc bindinghttps://redmine.ruby-lang.org/issues/146?journal_id=794562019-07-15T14:57:49Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Backport</i></li><li><strong>Project</strong> changed from <i>Ruby 1.8</i> to <i>Backport187</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/79456/diff?detail_id=52731">diff</a>)</li><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>ruby -v</strong> deleted (<del><i>-</i></del>)</li></ul>