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#31919: 26.1.50; Lisp Debugger doesn't work when at stack limit Date: Wed, 27 Jun 2018 21:26:12 -0700 Message-ID: <87r2krfsez.fsf@runbox.com> References: <87a7rprokq.fsf@runbox.com> <87vaa4f8ty.fsf@runbox.com> <83vaa4p1uc.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1530159907 14025 195.159.176.226 (28 Jun 2018 04:25:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 28 Jun 2018 04:25:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) Cc: 31919@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 28 06:25:03 2018 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 1fYOUQ-0003Rr-Dh for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jun 2018 06:25:02 +0200 Original-Received: from localhost ([::1]:34516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYOWV-0005m8-S4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jun 2018 00:27:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYOWP-0005m1-Oa for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2018 00:27:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYOWM-0000oW-KY for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2018 00:27:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58410) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYOWM-0000oM-Fx for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2018 00:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fYOWM-0000v1-5S for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2018 00:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gemini Lasswell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jun 2018 04:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31919 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31919-submit@debbugs.gnu.org id=B31919.15301599903485 (code B ref 31919); Thu, 28 Jun 2018 04:27:02 +0000 Original-Received: (at 31919) by debbugs.gnu.org; 28 Jun 2018 04:26:30 +0000 Original-Received: from localhost ([127.0.0.1]:38074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYOVp-0000u9-W8 for submit@debbugs.gnu.org; Thu, 28 Jun 2018 00:26:30 -0400 Original-Received: from aibo.runbox.com ([91.220.196.211]:50586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYOVn-0000u0-T4 for 31919@debbugs.gnu.org; Thu, 28 Jun 2018 00:26:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From; bh=LoAixAuUO9Ov07O3MAXmcbv7BjcX+CDoZETNaSybvhY=; b=P9lasiSKdPqJO3MQD8RgsGPjf2 2nOPEmBqiClba2IE6pCt3nEw+n0JIinZ08bhhwSc1+hYVgvhd9eK0hvs7jgZGnW6cLK+zAQl6YwC+ wHe/YvMKoD7jBZ4FewxaR68FiVnUhFZ8gz2fzcvMUA5CkKBKJkSCENPD/D7gVftBFN5OmB6yNtBvB 5Ibn2eLV/vMQGVsRwNfhwXzqCyIKdRoqNFF6jGlswX3Kz3vWD+5eYbMEpGZOQvqzLWUTyIA7/IwgY N95K7dak59CZRgRWoxMCbvyS7nG/0MOcY1c52H4E99W3seg5G2dpyS+fCejExMb4Q6UykyyuWxl1/ Vj/F8r7A==; Original-Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1fYOVm-00045j-GF; Thu, 28 Jun 2018 06:26:26 +0200 Original-Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=chinook) by mailfront10.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1fYOVa-0004at-9M; Thu, 28 Jun 2018 06:26:14 +0200 In-Reply-To: <83vaa4p1uc.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Jun 2018 20:37:47 +0300") 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:147888 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii 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. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=0001-Increase-max-lisp-eval-depth-adjustment-while-in-deb.patch >From ab293d12ef045042b62df7670cf9fe05f175ce19 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell 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 --=-=-=--