From unknown Sat Aug 16 18:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24713: 26.0.50; edebug-max-depth should be customizable Resent-From: Gemini Lasswell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Oct 2016 22:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24713 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 24713@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.147665516122910 (code B ref -1); Sun, 16 Oct 2016 22:00:03 +0000 Received: (at submit) by debbugs.gnu.org; 16 Oct 2016 21:59:21 +0000 Received: from localhost ([127.0.0.1]:35722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvtSj-0005xR-95 for submit@debbugs.gnu.org; Sun, 16 Oct 2016 17:59:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvtSh-0005xF-Dk for submit@debbugs.gnu.org; Sun, 16 Oct 2016 17:59:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvtSb-0007f5-5X for submit@debbugs.gnu.org; Sun, 16 Oct 2016 17:59:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bvtSb-0007f1-2w for submit@debbugs.gnu.org; Sun, 16 Oct 2016 17:59:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvtSZ-0006E1-R1 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 17:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvtSW-0007dy-P2 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 17:59:11 -0400 Received: from aibo.runbox.com ([91.220.196.211]:49923) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bvtSW-0007dP-Hi for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 17:59:08 -0400 Received: from [10.9.9.213] (helo=mailfront13.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1bvtSP-0002Tk-Gk for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 23:59:01 +0200 Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=rainbow.local) by mailfront13.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1bvtSI-0000Pe-79 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 23:58:54 +0200 From: Gemini Lasswell Date: Sun, 16 Oct 2016 14:58:44 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --=-=-= Content-Type: text/plain Edebug's recursion limit is currently 150, but this is not enough for the following files in the Emacs source tree: lisp/calc/calc-ext.el lisp/help-macro.el lisp/international/fontset.el The latter two can be successfully instrumented with edebug-max-depth set to 200, but the minimum value necessary for calc-ext.el is somewhere between 500 and 1000. All three of these files contain large quoted lists. I'm attaching a patch to accomplish this. I chose to mention max-lisp-eval-depth and max-specpdl-size in the defcustom docstring, but I also noticed that Edebug temporarily bumps max-lisp-eval-depth up by 800 while it's working. I could modify the patch to replace the 800 by something along the lines of (+ 200 (* max-edebug-depth 4)), if someone with more Emacs experience than me says it is a good idea. Edebug also increases max-specpdl-size (by 2000) so that probably would also need to be changed in the code. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Change-edebug-max-depth-from-defconst-to-defcustom.patch >From 860deea4d3ff07c105435ac36c8477fcb6e1d008 Mon Sep 17 00:00:00 2001 From: gazally Date: Sun, 16 Oct 2016 13:34:56 -0700 Subject: [PATCH] Change edebug-max-depth from defconst to defcustom Make edebug-max-depth customizable to give Edebug the ability to instrument code containing very large quoted lists. * lisp/emacs-lisp/edebug.el (edebug-max-depth): Add defcustom. --- lisp/emacs-lisp/edebug.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 6918539..facbda8 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -112,6 +112,18 @@ edebug-eval-macro-args :type 'boolean :group 'edebug) +(defcustom edebug-max-depth 150 + "Maximum recursion depth when instrumenting code. +This limit stops recursion if an Edebug specification contains an +infinite loop. When Edebug is instrumenting code containing very +large quoted lists, it may reach this limit and give the error +message \"Too deep - perhaps infinite loop in spec?\" You can +safely make this limit considerably larger than its default +value, but you may also need to increase `max-lisp-eval-depth' +and `max-specpdl-size'." + :type 'integer + :group 'edebug) + (defcustom edebug-save-windows t "If non-nil, Edebug saves and restores the window configuration. That takes some time, so if your program does not care what happens to @@ -1452,7 +1464,6 @@ edebug-list-form (defvar edebug-after-dotted-spec nil) (defvar edebug-matching-depth 0) ;; initial value -(defconst edebug-max-depth 150) ;; maximum number of matching recursions. ;;; Failure to match -- 2.10.1 --=-=-=-- From unknown Sat Aug 16 18:18:40 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Gemini Lasswell Subject: bug#24713: closed (Re: bug#24713: 26.0.50; edebug-max-depth should be customizable) Message-ID: References: <83o9yi8bdi.fsf@gnu.org> X-Gnu-PR-Message: they-closed 24713 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 24713@debbugs.gnu.org Date: Sat, 04 Feb 2017 11:06:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1486206362-30440-1" This is a multi-part message in MIME format... ------------=_1486206362-30440-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #24713: 26.0.50; edebug-max-depth should be customizable which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 24713@debbugs.gnu.org. --=20 24713: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24713 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1486206362-30440-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 24713-done) by debbugs.gnu.org; 4 Feb 2017 11:05:36 +0000 Received: from localhost ([127.0.0.1]:55523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZy9w-0007uN-4x for submit@debbugs.gnu.org; Sat, 04 Feb 2017 06:05:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZy9u-0007uA-8E for 24713-done@debbugs.gnu.org; Sat, 04 Feb 2017 06:05:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZy9k-0003hY-2i for 24713-done@debbugs.gnu.org; Sat, 04 Feb 2017 06:05:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZy9j-0003hU-W3; Sat, 04 Feb 2017 06:05:24 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1320 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cZy9j-000259-9X; Sat, 04 Feb 2017 06:05:23 -0500 Date: Sat, 04 Feb 2017 13:05:13 +0200 Message-Id: <83o9yi8bdi.fsf@gnu.org> From: Eli Zaretskii To: Gemini Lasswell In-reply-to: (message from Gemini Lasswell on Sun, 16 Oct 2016 14:58:44 -0700) Subject: Re: bug#24713: 26.0.50; edebug-max-depth should be customizable References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 24713-done Cc: 24713-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Gemini Lasswell > Date: Sun, 16 Oct 2016 14:58:44 -0700 > > Edebug's recursion limit is currently 150, but this is not enough for > the following files in the Emacs source tree: > > lisp/calc/calc-ext.el > lisp/help-macro.el > lisp/international/fontset.el > > The latter two can be successfully instrumented with edebug-max-depth > set to 200, but the minimum value necessary for calc-ext.el is somewhere > between 500 and 1000. All three of these files contain large quoted > lists. > > I'm attaching a patch to accomplish this. Thanks, pushed. A few minor nits for the future: . when you add/modify a defcustom, always specify a :version tag . please always mention the bug number in the commit log message, otherwise it must be added by hand, which is error-prone . user-visible changes should be accompanied by suitable changes to NEWS and the manuals (I did it this time) . please use the US English convention of leaving 2 spaces between sentences -- this is what we use in Emacs documentation . please configure your Git repo (on Github?) so that your user name is identical to what you use to send email, to avoid confusion ------------=_1486206362-30440-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Oct 2016 21:59:21 +0000 Received: from localhost ([127.0.0.1]:35722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvtSj-0005xR-95 for submit@debbugs.gnu.org; Sun, 16 Oct 2016 17:59:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvtSh-0005xF-Dk for submit@debbugs.gnu.org; Sun, 16 Oct 2016 17:59:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvtSb-0007f5-5X for submit@debbugs.gnu.org; Sun, 16 Oct 2016 17:59:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bvtSb-0007f1-2w for submit@debbugs.gnu.org; Sun, 16 Oct 2016 17:59:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvtSZ-0006E1-R1 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 17:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvtSW-0007dy-P2 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 17:59:11 -0400 Received: from aibo.runbox.com ([91.220.196.211]:49923) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bvtSW-0007dP-Hi for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 17:59:08 -0400 Received: from [10.9.9.213] (helo=mailfront13.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1bvtSP-0002Tk-Gk for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 23:59:01 +0200 Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=rainbow.local) by mailfront13.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1bvtSI-0000Pe-79 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 23:58:54 +0200 From: Gemini Lasswell To: bug-gnu-emacs@gnu.org Subject: 26.0.50; edebug-max-depth should be customizable Date: Sun, 16 Oct 2016 14:58:44 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --=-=-= Content-Type: text/plain Edebug's recursion limit is currently 150, but this is not enough for the following files in the Emacs source tree: lisp/calc/calc-ext.el lisp/help-macro.el lisp/international/fontset.el The latter two can be successfully instrumented with edebug-max-depth set to 200, but the minimum value necessary for calc-ext.el is somewhere between 500 and 1000. All three of these files contain large quoted lists. I'm attaching a patch to accomplish this. I chose to mention max-lisp-eval-depth and max-specpdl-size in the defcustom docstring, but I also noticed that Edebug temporarily bumps max-lisp-eval-depth up by 800 while it's working. I could modify the patch to replace the 800 by something along the lines of (+ 200 (* max-edebug-depth 4)), if someone with more Emacs experience than me says it is a good idea. Edebug also increases max-specpdl-size (by 2000) so that probably would also need to be changed in the code. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Change-edebug-max-depth-from-defconst-to-defcustom.patch >From 860deea4d3ff07c105435ac36c8477fcb6e1d008 Mon Sep 17 00:00:00 2001 From: gazally Date: Sun, 16 Oct 2016 13:34:56 -0700 Subject: [PATCH] Change edebug-max-depth from defconst to defcustom Make edebug-max-depth customizable to give Edebug the ability to instrument code containing very large quoted lists. * lisp/emacs-lisp/edebug.el (edebug-max-depth): Add defcustom. --- lisp/emacs-lisp/edebug.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 6918539..facbda8 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -112,6 +112,18 @@ edebug-eval-macro-args :type 'boolean :group 'edebug) +(defcustom edebug-max-depth 150 + "Maximum recursion depth when instrumenting code. +This limit stops recursion if an Edebug specification contains an +infinite loop. When Edebug is instrumenting code containing very +large quoted lists, it may reach this limit and give the error +message \"Too deep - perhaps infinite loop in spec?\" You can +safely make this limit considerably larger than its default +value, but you may also need to increase `max-lisp-eval-depth' +and `max-specpdl-size'." + :type 'integer + :group 'edebug) + (defcustom edebug-save-windows t "If non-nil, Edebug saves and restores the window configuration. That takes some time, so if your program does not care what happens to @@ -1452,7 +1464,6 @@ edebug-list-form (defvar edebug-after-dotted-spec nil) (defvar edebug-matching-depth 0) ;; initial value -(defconst edebug-max-depth 150) ;; maximum number of matching recursions. ;;; Failure to match -- 2.10.1 --=-=-=-- ------------=_1486206362-30440-1--