From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8D6D91F44D for ; Fri, 16 Feb 2024 20:31:52 +0000 (UTC) Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id A87D882A44; Fri, 16 Feb 2024 20:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1708115504; bh=WPgiliAlRln4AEimLneH8JK6BfH8B32SM6nd5QdHGiM=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=WKNEnTp/t36EPKLF4M7s+HbbUOKcgxKnjp8SYmDNaXJAPFEVvApe6x5rDko/ONN11 jVfsjUL81ETDMkDKdvZy3DutHMA5s/tFpcvRFK6keEjMTlmdoLus5AC8sL4DW28cSv shdOQ2IuMdCDK6unSv/QvIz+tLOqqgpeufdLAxLg= Received: from s.csnrwnwx.outbound-mail.sendgrid.net (s.csnrwnwx.outbound-mail.sendgrid.net [198.37.146.154]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 778C182A3E for ; Fri, 16 Feb 2024 20:31:40 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=FdOF1I36; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=doKx0rVoZQ0quaIEB6E/WG/T78O+yRdE1z0e8tdCunM=; b=FdOF1I360C5rzg6iJqeUiHag+sBUhTO10366c4PjOxhm0S8w86nmWPlaa7t6EmcOudGN k/PV6z0hy+gx32nuA8KIIJTOZqIdZczDMfYZfuqWJawL/KCSzLgPlqiS7viQjPB+SoRaZA 39kl99T28Xs98ytfOnem/Xy6BVI38iVAUiaGy2O1vp4dtJfV0n8AGl9a3vazQqDE6mJb2N 67GKaN6M+GEWQEl/BfTBF+xmSH6gg9mXA/1zMGnYwKSVf5KymHYXKMyyRUqdNVVy+DBbtA UZm4meyFnjnoMnFjvGqkDbzsJUTQdXy0M8wLLXcM/u3idevxdQWlC7qYHKA8BYYA== Received: by filterdrecv-58bfc74dd6-dgkl4 with SMTP id filterdrecv-58bfc74dd6-dgkl4-1-65CFC62A-26 2024-02-16 20:31:38.469762257 +0000 UTC m=+1923302.503875520 Received: from herokuapp.com (unknown) by geopod-ismtpd-39 (SG) with ESMTP id BYVwwdgRTGqVW8X9HFms7A for ; Fri, 16 Feb 2024 20:31:38.426 +0000 (UTC) Date: Fri, 16 Feb 2024 20:31:38 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 19117 X-Redmine-Issue-Author: byroot 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-Redmine-MailingListIntegration-Message-Ids: 93363 X-SG-EID: =?us-ascii?Q?DvL3W2Xo+Vk=2FeUn3F50L=2FNc8u9NqZCnbE0mXZHiyye4R1YZg=2FtAFc0SAFzpcS=2F?= =?us-ascii?Q?Zcr7BqPN=2FYCcMZBMITNeIci9STxYay0JAJWPbek?= =?us-ascii?Q?rFR+qUnzlR6glXps5MAL04rr9a9vYXVA0UX5B3e?= =?us-ascii?Q?DICuQQBsoe9Q0mMtS3Lj2NUkOE3E+n=2FR9ZQ=2FHr7?= =?us-ascii?Q?PPGFDLa3zm7a=2FQ5=2FC6eySh4db7JdJa2RD2mYF06?= =?us-ascii?Q?N=2Fumpw0HCSKEGFLCJ2j++B9tgWs0YS8CJpSwDop?= =?us-ascii?Q?QMZM5gZK80Z39LpvJBzSQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: 3SD4JX5R5CRFRRKAF7TLYEO6QXBKMCSZ X-Message-ID-Hash: 3SD4JX5R5CRFRRKAF7TLYEO6QXBKMCSZ X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:116807] [Ruby master Feature#19117] Include the method owner in backtraces, not just the method name List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Eregon (Benoit Daloze) via ruby-core" Cc: "Eregon (Benoit Daloze)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #19117 has been updated by Eregon (Benoit Daloze). I'm in favor to keep it removed, because these are implementation details. Although ideally in backtraces I think it would be best to hide the entry corresponding to `rescue in`/`ensure in`, i.e., instead of: ``` /tmp/foo.rb:7:in `rescue in rescue in raise_nested_exceptions': Third error (RuntimeError) from /tmp/foo.rb:4:in `rescue in raise_nested_exceptions' from /tmp/foo.rb:1:in `raise_nested_exceptions' from /tmp/foo.rb:11:in `
' ``` have: ``` /tmp/foo.rb:7:in 'Object#raise_nested_exceptions': Third error (RuntimeError) from /tmp/foo.rb:11:in '
' ``` Since there are no calls from Ruby semantics POV and the extra frames are a CRuby implementation detail (e.g. TruffleRuby does not have extra call frames for `rescue` and `ensure`, not sure about JRuby). ---------------------------------------- Feature #19117: Include the method owner in backtraces, not just the method name https://bugs.ruby-lang.org/issues/19117#change-106830 * Author: byroot (Jean Boussier) * Status: Closed * Priority: Normal * Target version: 3.4 ---------------------------------------- ``` module Foo class Bar def inspect 1 + '1' end end end p Foo::Bar.new ``` This code produce the following backtrace: ``` /tmp/foo.rb:4:in `+': String can't be coerced into Integer (TypeError) from /tmp/foo.rb:4:in `inspect' from /tmp/foo.rb:9:in `p' from /tmp/foo.rb:9:in `
' ``` This works, but on large codebases and large backtraces the method name isn't always all that revealing, most of the time you need to open many of the locations listed in the backtrace to really understand what is going on. I propose that we also include the owner name: ``` /tmp/foo.rb:4:in `Integer#+': String can't be coerced into Integer (TypeError) from /tmp/foo.rb:4:in `Foo::Bar#inspect' from /tmp/foo.rb:9:in `Kernel#p' from /tmp/foo.rb:9:in `
' ``` I believe that in many case it would allow to much better understand the backtrace without having to jump back and forth between it and the source code. This is inspired by @ivoanjo 's `backtracie` gem: https://github.com/ivoanjo/backtracie -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/