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.1 required=3.0 tests=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_HELO_NONE,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 687F71F462 for ; Tue, 4 Jun 2019 12:21:02 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 45253120A60; Tue, 4 Jun 2019 21:20: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 6E96A120994 for ; Tue, 4 Jun 2019 21:20:52 +0900 (JST) Received: by filter0136p3las1.sendgrid.net with SMTP id filter0136p3las1-27559-5CF66224-35 2019-06-04 12:20:52.999768728 +0000 UTC m=+1018749.085643564 Received: from herokuapp.com (unknown [52.23.244.33]) by ismtpd0036p1iad1.sendgrid.net (SG) with ESMTP id Si7EnNyHR5i1l5fgtyF_qg for ; Tue, 04 Jun 2019 12:20:52.882 +0000 (UTC) Date: Tue, 04 Jun 2019 12:20:53 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68432 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: =?us-ascii?Q?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr3kwIza0QzN1qx6vaDorL?= =?us-ascii?Q?i9AA+GT23VTPqiAW=2FLvseu1ySJr+E5s1hrU8Kf4?= =?us-ascii?Q?m1OZQynxgwF86yRKh8xE85lktgfrYOdUp=2FOBLLU?= =?us-ascii?Q?D0QWZhvrOIlh1ro5dDWrzSNxVaycI86yPnbIrp2?= =?us-ascii?Q?qYVN3N68YQJrIbGZwlkucv43Em1rmJCrr1w=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92955 Subject: [ruby-core:92955] [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 updated by Eregon (Benoit Daloze). I plan to fix this and copy the backtrace too in MRI, because it looks not intentional and inconsistent. Anyone against? ---------------------------------------- Bug #15558: Should Exception#exception copy the backtrace? https://bugs.ruby-lang.org/issues/15558#change-78332 * 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/