Project

General

Profile

Bug #14738

Failed to load_from_binary on 2.5.1

Added by znz (Kazuhiro NISHIYAMA) over 1 year ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
[ruby-core:86877]

Description

%  cat /tmp/1226.rb
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
p RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
%  ruby -v /tmp/1226.rb
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
<compiled>:1: warning: assigned but unused variable - num
Traceback (most recent call last):
    1: from /tmp/1226.rb:3:in `<main>'
/tmp/1226.rb:3:in `load_from_binary': wrong argument type nil (expected String) (TypeError)

rubyfarm-bisect says first bad commit is r58979.
It seems trunk is aleady fixed.

Associated revisions

Revision 62772
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: fix load_from_binary

From: nobu nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision b1944e41
Added by nagachika (Tomoyuki Chikanaga) 9 months ago

merge revision(s) 62772: [Backport #14738]

    compile.c: fix load_from_binary

    * compile.c (ibf_load_iseq_each): realpath may be nil.  follow up
      r59709.  [fix https://github.com/Shopify/bootsnap/issues/132]

    From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@65728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 65728
Added by nagachika (Tomoyuki Chikanaga) 9 months ago

merge revision(s) 62772: [Backport #14738]

compile.c: fix load_from_binary

* compile.c (ibf_load_iseq_each): realpath may be nil.  follow up
  r59709.  [fix https://github.com/Shopify/bootsnap/issues/132]

From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>

History

#1

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

"extra_data" is not necessary.

Updated by nagachika (Tomoyuki Chikanaga) 9 months ago

  • Backport changed from 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE

ruby_2_5 r65728 merged revision(s) 62772.

Also available in: Atom PDF