From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 327D81F4B4 for ; Fri, 2 Oct 2020 15:58:03 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 74E431209E3; Sat, 3 Oct 2020 00:57:26 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 3B0E31209A1 for ; Sat, 3 Oct 2020 00:57:24 +0900 (JST) Received: by filterdrecv-p3iad2-df8579867-kwdns with SMTP id filterdrecv-p3iad2-df8579867-kwdns-18-5F774DFF-4F 2020-10-02 15:57:51.763071398 +0000 UTC m=+928762.606785597 Received: from herokuapp.com (unknown) by geopod-ismtpd-2-0 (SG) with ESMTP id Cg_PUF3gQlCyr9bBaD0EJw for ; Fri, 02 Oct 2020 15:57:51.681 +0000 (UTC) Date: Fri, 02 Oct 2020 15:57:51 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 76122 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17192 X-Redmine-Issue-Author: wanabe X-Redmine-Sender: nobu X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?q8Dly+pU2+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4BwK6cDa=2FLSM3ZovkqFP6V?= =?us-ascii?Q?lEgeF4p6RtEQnA5sN6B4=2FjTZ1XPxmu6=2FXJMsst9?= =?us-ascii?Q?mBY5qEFzfU0ZwbqCECgcUW+La6ouL091HkVsVCN?= =?us-ascii?Q?Aw9sfB0RRfVTMcGSxF0Qc3ZPYwrKToP6AZkxysW?= =?us-ascii?Q?KL1YmVsZQxIHWkeVEdoOSllgc5P+hXO5NvQdVmt?= =?us-ascii?Q?OPIzLgvfDb2IKiMck=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 100281 Subject: [ruby-core:100281] [Ruby master Bug#17192] ISeq.load_from_binary can cause BUG if binary is a rbinc-derived X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17192 has been updated by nobu (Nobuyoshi Nakada). Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED https://github.com/ruby/ruby/pull/3622 ---------------------------------------- Bug #17192: ISeq.load_from_binary can cause BUG if binary is a rbinc-derived https://bugs.ruby-lang.org/issues/17192#change-87867 * Author: wanabe (_ wanabe) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.0dev (2020-09-25T22:52:04Z master 137fa5b27e) [x86_64-linux] * Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED ---------------------------------------- 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 `
' -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/