ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: s.wanabe@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:100165] [Ruby master Bug#17192] ISeq.load_from_binary can cause BUG if binary is a rbinc-derived
Date: Sat, 26 Sep 2020 07:18:17 +0000 (UTC)	[thread overview]
Message-ID: <redmine.issue-17192.20200926071817.92@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17192.20200926071817.92@ruby-lang.org

Issue #17192 has been reported by wanabe (_ wanabe).

----------------------------------------
Bug #17192: ISeq.load_from_binary can cause BUG if binary is a rbinc-derived
https://bugs.ruby-lang.org/issues/17192

* Author: wanabe (_ wanabe)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
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.



-- 
https://bugs.ruby-lang.org/

       reply	other threads:[~2020-09-26  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-26  7:18 s.wanabe [this message]
2020-10-02 15:57 ` [ruby-core:100281] [Ruby master Bug#17192] ISeq.load_from_binary can cause BUG if binary is a rbinc-derived nobu
2021-02-11  5:08 ` [ruby-core:102455] " nagachika00

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.issue-17192.20200926071817.92@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).