From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#74294: Master: debug-on-error is ineffective whilst requiring a file from the byte compiler. Date: Sun, 10 Nov 2024 13:05:36 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18659"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier To: 74294@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 10 14:06:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tA7dy-0004j2-Td for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Nov 2024 14:06:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tA7dl-0000ZH-VO; Sun, 10 Nov 2024 08:06:05 -0500 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 1tA7dk-0000Z0-GY for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 08:06:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tA7dj-000275-OF for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 08:06:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:MIME-Version:Date:To:Subject; bh=uFkxUqLRTmAR0iBwyiSg6Ri4ERhbhJt2ZcvOyuat5kU=; b=YAX3fHQvBUxOFtbZUeVbcgV+OUViDniCdk4JUmAnXBTr0YUjp+NLfupgz4F9QGnJWRpnnb9KjKBGC5sZqu99lm1B6SarA1DeqN5/BGMe5fsB9JCMIodAhsgIXEkdbqNG3aWD3LLpC9wlVswg6A5ANlUWt8lzfzUTgFY6aZL61XlF/DEvOAqXY+wDhylPOP6TxjGSmP7WqdRVSbbVdubosH1NbPjwDIi+RwrVNWi1ucQ9cBN6VLjG3G7AMQv9toy2JlIGRXyHw57bTYTvg7epQHw209zcXcuxzszyZywhJ+tcKx1Tc5npm35uFBIETCp/zvK8CWqWya6dosUsuEN1LA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tA7di-0000pL-Ov; Sun, 10 Nov 2024 08:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Nov 2024 13:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74294 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.17312439503157 (code B ref -1); Sun, 10 Nov 2024 13:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Nov 2024 13:05:50 +0000 Original-Received: from localhost ([127.0.0.1]:56117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tA7dV-0000oq-Su for submit@debbugs.gnu.org; Sun, 10 Nov 2024 08:05:50 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:36226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tA7dT-0000oi-N7 for submit@debbugs.gnu.org; Sun, 10 Nov 2024 08:05:48 -0500 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 1tA7dS-0000Ms-En for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 08:05:47 -0500 Original-Received: from mail.muc.de ([193.149.48.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tA7dO-00022v-DS for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 08:05:45 -0500 Original-Received: (qmail 38180 invoked by uid 3782); 10 Nov 2024 14:05:37 +0100 Original-Received: from muc.de (pd953a71d.dip0.t-ipconnect.de [217.83.167.29]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 10 Nov 2024 14:05:36 +0100 Original-Received: (qmail 16004 invoked by uid 1000); 10 Nov 2024 13:05:36 -0000 Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.3; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295186 Archived-At: Hello, Emacs. In master (any recent version): Create the following files: 1: ~/test-byte-compile-errors.el: ######################################################################### ;; -*- lexical-binding:t -*- (require 'test-byte-compile-errors-2 "~/test-byte-compile-errors-2") ######################################################################### 2: ~/test-byte-compile-errors-2.el: ######################################################################### ;; -*- lexical-binding:t -*- (car 'baz) (provide 'test-byte-compile-errors-2) ######################################################################### (Note the erroneous (car 'baz) in this file.) (i) emacs -Q (ii) M-: (setq debug-on-error t) RET (iii) M-x byte-compile-file RET ~/test-byte-compile-errors.el RET (iv) The error message: test-byte-compile-errors.el:2:11: Error: Wrong type argument: listp, baz is displayed. The debugger is not run. This is surely a bug. (Note also, the file name displayed is not that where the error is: See bug#66912.) ######################################################################### Diagnosis --------- In the function bytecomp--displaying-warnings (bytecomp.el), a blocking condition-case is set up, except when byte-compile-debug is non-nil. This prevents the debugger running. The problem is, the effect of this condition-case prevails even outside the byte compiler whilst loading a file with `require'. ######################################################################### Proposed Resolution ------------------- Set up one or more handler-binds around the parts of Fload that evaluate the contents of the file being loaded. In the event of an error, the handler-bind handler would trigger, test debug-on-error, and if it's set appropriately, call the debugger, then quit. Otherwise, the handler would return, and the error handling would eventually reach the condition-case set up by bytecomp--displaying-warnings. -- Alan Mackenzie (Nuremberg, Germany).