all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gemini Lasswell <gazally@runbox.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 31919@debbugs.gnu.org
Subject: bug#31919: 26.1.50; Lisp Debugger doesn't work when at stack limit
Date: Wed, 27 Jun 2018 21:26:12 -0700	[thread overview]
Message-ID: <87r2krfsez.fsf@runbox.com> (raw)
In-Reply-To: <83vaa4p1uc.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Jun 2018 20:37:47 +0300")

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

> Yes, but please add a comment there describing the reason.  How much
> more depth out of 40 is actually needed to allow cl-print calls, and
> how much is safety margin?

I determined by experiment that 77 needs to be added to
max-lisp-eval-depth to permit the debugger to print
((1 (2 (3 (4 (5 (6 (7 (8))))))))).  So I changed the increment to 100.
But I really have no idea what is reasonable for a safety margin.
Here's a new patch with comments.


[-- Attachment #2: 0001-Increase-max-lisp-eval-depth-adjustment-while-in-deb.patch --]
[-- Type: text/plain, Size: 2010 bytes --]

From ab293d12ef045042b62df7670cf9fe05f175ce19 Mon Sep 17 00:00:00 2001
From: Gemini Lasswell <gazally@runbox.com>
Date: Wed, 20 Jun 2018 13:58:33 -0700
Subject: [PATCH] Increase max-lisp-eval-depth adjustment while in debugger

* src/eval.c (call_debugger): Increase the amount of extra Lisp
evaluation depth given to the debugger to allow it to call cl-print.
* lisp/emacs-lisp/debug.el (debugger-setup-buffer): Add a comment
to suggest updating call_debugger when changing print-level.
---
 lisp/emacs-lisp/debug.el | 1 +
 src/eval.c               | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 593fab9727..821d674882 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -322,6 +322,7 @@ debugger-setup-buffer
                  (backtrace-frames 'debug)))
         (print-escape-newlines t)
         (print-escape-control-characters t)
+        ;; If you increase print-level, add more depth in call_debugger.
         (print-level 8)
         (print-length 50)
         (pos (point)))
diff --git a/src/eval.c b/src/eval.c
index ca1eb84ff3..40cba3bb1c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -282,8 +282,12 @@ call_debugger (Lisp_Object arg)
   /* Do not allow max_specpdl_size less than actual depth (Bug#16603).  */
   EMACS_INT old_max = max (max_specpdl_size, count);
 
-  if (lisp_eval_depth + 40 > max_lisp_eval_depth)
-    max_lisp_eval_depth = lisp_eval_depth + 40;
+  /* The previous value of 40 is too small now that the debugger
+     prints using cl-prin1 instead of prin1.  Printing lists nested 8
+     deep (which is the value of print-level used in the debugger)
+     currently requires 77 additional frames.  See bug#31919.  */
+  if (lisp_eval_depth + 100 > max_lisp_eval_depth)
+    max_lisp_eval_depth = lisp_eval_depth + 100;
 
   /* While debugging Bug#16603, previous value of 100 was found
      too small to avoid specpdl overflow in the debugger itself.  */
-- 
2.16.4


  reply	other threads:[~2018-06-28  4:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21  0:05 bug#31919: 26.1.50; Lisp Debugger doesn't work when at stack limit Gemini Lasswell
2018-06-27 17:16 ` Gemini Lasswell
2018-06-27 17:37   ` Eli Zaretskii
2018-06-28  4:26     ` Gemini Lasswell [this message]
2018-06-30  9:39       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r2krfsez.fsf@runbox.com \
    --to=gazally@runbox.com \
    --cc=31919@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.