Project

General

Profile

Actions

Bug #17192

closed

ISeq.load_from_binary can cause BUG if binary is a rbinc-derived

Added by wanabe (_ wanabe) over 3 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0dev (2020-09-25T22:52:04Z master 137fa5b27e) [x86_64-linux]
[ruby-core:100165]

Description

The following command can cause BUG.

$ ruby -e 'print RubyVM::InstructionSequence.of(1.method(:abs)).to_binary'|ruby -e 'RubyVM::InstructionSequence.load_from_binary(ARGF.read)'
-e:1: [BUG] ibf_load_builtin: table is not provided.
ruby 3.0.0dev (2020-09-25T22:52:04Z master 137fa5b27e) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0003 p:---- s:0011 e:000010 CFUNC  :load_from_binary
c:0002 p:0026 s:0006 e:000005 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0003 E:001910 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
-e:1:in `load_from_binary'

-- C level backtrace information -------------------------------------------
[0x5635c8378d2e]
/home/wanabe/.rbenv/versions/master/bin/ruby(rb_bug+0xe9) [0x5635c817641c] ../../error.c:686
[0x5635c817b772]
/home/wanabe/.rbenv/versions/master/bin/ruby(ibf_load_iseq+0xf3) [0x5635c83de093] ../../compile.c:11898
[0x5635c83de18e]
(snip)

I think that ISeq.of should raise some kind of exception on the case.
Or ISeq.load_from_binary may raise an exception.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0