Project

General

Profile

Actions

Bug #14809

closed

calc_lineno() returns wrong location

Added by ktsj (Kazuki Tsujimoto) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-06-02 master 63545) [x86_64-linux]
[ruby-dev:50557]

Description

r62051のコミット以降

$ cat -n t.rb
     1  class String
     2    def -@
     3      p caller_locations(1, 1)[0]
     4    end
     5  end
     6
     7  -""
$ ruby-trunk t.rb
"t.rb:1:in `<main>'"
$ ruby-2.5 t.rb
"t.rb:7:in `<main>'"

のように、位置情報が正しく取れなくなるという問題が起きています。

インストラクションの種類によってPCが変更されるタイミングが異なるようになったことが原因です。


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #14834: rb_profile_frames SEGV when PC adjusted on IFUNCClosedshyouhei (Shyouhei Urabe)Actions

Updated by shyouhei (Shyouhei Urabe) over 6 years ago

I'll take care of it.

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 6 years ago

  • Related to Bug #14834: rb_profile_frames SEGV when PC adjusted on IFUNC added
Actions #3

Updated by shyouhei (Shyouhei Urabe) over 6 years ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r63763.


give up insn attr handles_frame

I introduced this mechanism in r62051 to speed things up. Later it
was reported that the change causes problems. I searched for
workarounds but nothing seemed appropriate. I hereby officially
give it up. The idea to move ADD_PC around was a mistake.

Fixes [Bug #14809] and [Bug #14834].

Signed-off-by: Urabe, Shyouhei

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0