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=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_PASS 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 97E881F453 for ; Wed, 23 Jan 2019 16:18:59 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6BE56121546; Thu, 24 Jan 2019 01:18:55 +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 612B1121546 for ; Thu, 24 Jan 2019 01:18:52 +0900 (JST) Received: by filter0047p3iad2.sendgrid.net with SMTP id filter0047p3iad2-8526-5C4893E9-2F 2019-01-23 16:18:49.645061829 +0000 UTC m=+759942.475305288 Received: from herokuapp.com (ec2-54-211-52-65.compute-1.amazonaws.com [54.211.52.65]) by ismtpd0013p1iad2.sendgrid.net (SG) with ESMTP id VuDn6PegR8SFnP0TLeScIA for ; Wed, 23 Jan 2019 16:18:49.614 +0000 (UTC) Date: Wed, 23 Jan 2019 16:18:50 +0000 (UTC) From: eregontp@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66680 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15558 X-Redmine-Issue-Author: Eregon X-Redmine-Sender: Eregon 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4ZIZYQivvSZlA6x9/VnwjlpRBQeptKvvBPyn ltHQD69bf1b/6xt1fHbnY0UhflTI/0/m6VmLjAGdkd/sWPli3KBRTQsh8GOVHOvi9JR4BTCdaDCwse i5w+xBLP/Watyk/58b1rtYpUSjgmyMcUQXd16AZI0IUexwdV99eNVApULQ== X-ML-Name: ruby-core X-Mail-Count: 91232 Subject: [ruby-core:91232] [Ruby trunk Bug#15558] Should Exception#exception copy the backtrace? 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 #15558 has been reported by Eregon (Benoit Daloze). ---------------------------------------- Bug #15558: Should Exception#exception copy the backtrace? https://bugs.ruby-lang.org/issues/15558 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- Currently it does not on MRI: ``` ruby -e 'begin raise "foo"; rescue => e; c=e.exception "bar"; p c.backtrace; end' nil ``` But it does on JRuby 9.2.5.0 and TruffleRuby 1.0.0-rc11: ``` truffleruby -e 'begin raise "foo"; rescue => e; c=e.exception "bar"; p e.backtrace; end' ["-e:1:in `
'"] ``` This means in some cases, code needs about this difference such as in https://github.com/asciidoctor/asciidoctor/blob/41da20a47a8da96966ef3ec1c2f509e07e7920e3/lib/asciidoctor.rb#L1322-L1338 More context in: https://github.com/oracle/truffleruby/issues/1542#issuecomment-456850066 -- https://bugs.ruby-lang.org/