Project

General

Profile

Bug #17192

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

Added by wanabe (_ wanabe) 30 days ago. Updated 24 days ago.

Status:
Open
Priority:
Normal
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.

#1

Updated by wanabe (_ wanabe) 30 days ago

  • ruby -v set to ruby 3.0.0dev (2020-09-25T22:52:04Z master 137fa5b27e) [x86_64-linux]

Updated by nobu (Nobuyoshi Nakada) 24 days ago

  • Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED

Also available in: Atom PDF