From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: The poor quality of Emacs's backtraces Date: Fri, 14 Jul 2023 14:35:32 +0200 Message-ID: <6CB5E709-8F5A-4015-9F2C-337A87916C66@gmail.com> References: <3D901B62-4826-4783-B684-968E6890E75A@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9929"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 14 15:39:51 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qKJ1S-0002N3-QV for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Jul 2023 15:39:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKJ0R-0006kY-I6; Fri, 14 Jul 2023 09:38:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKI1N-0008TW-6t for emacs-devel@gnu.org; Fri, 14 Jul 2023 08:35:41 -0400 Original-Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qKI1J-000086-1a for emacs-devel@gnu.org; Fri, 14 Jul 2023 08:35:40 -0400 Original-Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b703a0453fso28174341fa.3 for ; Fri, 14 Jul 2023 05:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689338134; x=1691930134; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=onVAumOKoxW7rg/mDHCyN0CwNmQpax5Xbihbmtx4bb0=; b=QWeo6494+/Zx0Oi1bQ63YrVlOYqIktPWumOHnbccNt7UqOGh58vGIb6m0tdU4aD29o 3NJjsSU0VAIs4hoCqIYnVQrEEIvMk+JYCJUVUlfeypMf68w60mmZ6r0qxUtb+KYDMTkc 9Q8GRUwSyZbpU2h6ctmrqXd2mi/XpCtvvtyX96nfWWwjXu59PweJgJrpERK31GECOIuy CMDNgHCB7qndNNMzxven/fPKXN2PHLmECmapBO+ejFSPixsoIxO38XJafH+VwU+5m8z/ Dx91SArgv9rfihKKQtboqObxtth56/mGdGdo3yNyZt1ag6Dzsn0YeslmjDBVXtaJ+Ekf 5hHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689338134; x=1691930134; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=onVAumOKoxW7rg/mDHCyN0CwNmQpax5Xbihbmtx4bb0=; b=MfulW7cUmFQgWH3hn+lqWxDZsMyUgn/F0jjWlk/4WviI2VuJq6SMs7lesz5Lm/FZYY O9XLz8ATYxtTAiCS2D+cSOo6hGT3ippp4PV2nS+JPvLGxJmZ+vGqs/En0Caw2uk4Uy1x 7l0I7gbErXraAnCW+TgRSAGQQQzIFSkNOCeiBewKnekYLtVi9gVueAG6Hn204KzvJU8F rnwxwBGVxb1azySslHajncG4uxZ6x1kRw1sqlGYThbKIzb2F8f1pIP6ZcV86AcBcZcuR F1B2wNxOTkIs2181m3Io9iLxowfep8L6ftuPEAlwYu/QX43Q5YmeWRcZ3zwdUHeqDUeH duVw== X-Gm-Message-State: ABy/qLbymyy/rvN+zkcy1d2r0/OveVcufY9yKu5+95EB8nnAU/sAOuLN 32b7tOIUmhox4Eyj7lReUqc= X-Google-Smtp-Source: APBJJlHt3dw9uo7ATURvV96BT8cbwEfuXgRpi+pIJaw0m725lADkG51o/dQReaQDjQH5gczllvI/bg== X-Received: by 2002:a2e:3309:0:b0:2b7:3656:c594 with SMTP id d9-20020a2e3309000000b002b73656c594mr4591538ljc.3.1689338133913; Fri, 14 Jul 2023 05:35:33 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id p16-20020a2e7410000000b002b83dbc71c9sm254164ljc.54.2023.07.14.05.35.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2023 05:35:33 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=mattias.engdegard@gmail.com; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 14 Jul 2023 09:38:46 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307867 Archived-At: 14 juli 2023 kl. 12.48 skrev Alan Mackenzie : > It doesn't tell me which variable had > or which evaluation resulted in that invalid value. Here I was going to write a complaint about ERT and how it is to blame = for all the world's ills, but for all its flaws it actually makes an = effort to save the backtrace, using the debugger mechanism, before = unwinding the stack. (There is still plenty to fix in ERT. For example, it could use lexical = closures to its advantage, and avoid these huge macro-expansions.) The fault is perhaps closer to (my?) home: the bytecode interpreter = doesn't add a stack frame for many built-in ops. For example, (cdr 3) = will signal a `wrong-type-argument` error but `cdr` isn't in the = backtrace. That is something we could and should fix. At least for some ops it = should be pretty easy, and even a partial remedy would be helpful. Alan, = thank you for bringing this to my attention! > My enhancement is to store the @dfn{defining symbol} of anonymous > functions inside the function, whether an interpreted function, or > either type of compiled function. This symbol is the defun/defmacro > etc. within which the lambda is defined. Well, no, this isn't necessarily an improvement. If anything our = function objects are too fat; making them more so isn't what we need.