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-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=no 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 C4F911F97E for ; Tue, 27 Nov 2018 05:46:54 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4B0B0120C2F; Tue, 27 Nov 2018 14:46:53 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 692A5120C02 for ; Tue, 27 Nov 2018 14:46:50 +0900 (JST) Received: by filter0052p3mdw1.sendgrid.net with SMTP id filter0052p3mdw1-8733-5BFCDA47-1E 2018-11-27 05:46:47.738726276 +0000 UTC m=+292859.492028837 Received: from herokuapp.com (ec2-54-221-76-223.compute-1.amazonaws.com [54.221.76.223]) by ismtpd0054p1mdw1.sendgrid.net (SG) with ESMTP id jfRS--FrRO2QIaKUpZ6AoQ for ; Tue, 27 Nov 2018 05:46:47.689 +0000 (UTC) Date: Tue, 27 Nov 2018 05:46:48 +0000 (UTC) From: hunter_spawn@hotmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 65481 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15346 X-Redmine-Issue-Author: MaxLap X-Redmine-Sender: MaxLap 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS48mMJBmEdT+oMTgJShR5F5zjIKnBMmfGB0eS Kwk23SG3Az2KSggeSWsHp7RKIKo44wdy3wnDReJIRgnuZNl9LzV2+JkQy1/xrecd/gIlylRt71rkrb s3nf3e1f0Hz4dOAgW4YLlnl0EHpHLY+GOi/kFmTsaiJitlFswAy7j1nFEA== X-ML-Name: ruby-core X-Mail-Count: 90085 Subject: [ruby-core:90085] [Ruby trunk Bug#15346] Core dump during GC if covering a special require 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 #15346 has been reported by MaxLap (Maxime Lapointe). ---------------------------------------- Bug #15346: Core dump during GC if covering a special require https://bugs.ruby-lang.org/issues/15346 * Author: MaxLap (Maxime Lapointe) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0dev (2018-11-27 trunk 66002) [x86_64-linux] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- On my environment, (ruby-head, updated today) the following script generates a core dump almost all the time. (I join a core dump to this report) I am running on Ubuntu 16.04, I first saw the problem on Travis-CI and managed to make this much simpler reproduction code. ~~~ ruby # Just setting up a file to require, this could be in a regular file and be required. require 'tempfile' f = Tempfile.new(['ruby', '.rb']) f.write(<<-RUBY) a = 123 begin ensure a end RUBY f.close # Now the actual code to trigger the problem require 'coverage' Coverage.start load f.path # require can do the same thing, but less frequently # The problem is during GC, so we trigger it ourself puts 'gc time!' GC.start # When it doesn't crash the first time, doing the load/require again seems to take care of it puts '2nd gc' load f.path GC.start puts 'gc done, try again!' ~~~ The problem seems related to the content of the ensure, if it's too simple, things break? It's weird. If the content of the ensure is: a puts 'something' #=> All good puts 'something' a #=> Core dump puts 'something'; a #=> All good a + 1 #=> All good My personal guess is, if the last line of the ensure is useless, ruby optimizes it away, but that causes a problem with Coverage. ---Files-------------------------------- cov-require_core_dump.txt (10.4 KB) -- https://bugs.ruby-lang.org/