From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gemini Lasswell Newsgroups: gmane.emacs.bugs Subject: bug#24713: 26.0.50; edebug-max-depth should be customizable Date: Sun, 16 Oct 2016 14:58:44 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1476655221 21950 195.159.176.226 (16 Oct 2016 22:00:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Oct 2016 22:00:21 +0000 (UTC) To: 24713@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 17 00:00:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvtTZ-0004ez-17 for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 00:00:13 +0200 Original-Received: from localhost ([::1]:57895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvtTb-0006ci-6V for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Oct 2016 18:00:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvtTT-0006ZH-MM for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 18:00:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvtTP-0007qd-Sl for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 18:00:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvtTP-0007qZ-Ph for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 18:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bvtTP-0005z3-GZ for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 18:00:03 -0400 X-Loop: help-debbugs@gnu.org 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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147665516122910 (code B ref -1); Sun, 16 Oct 2016 22:00:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Oct 2016 21:59:21 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124568 Archived-At: --=-=-= 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 --=-=-=--