unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: Glenn Morris <rgm@gnu.org>, 46818@debbugs.gnu.org
Subject: bug#46818: leim bootstrap: Variable binding depth exceeds max-specpdl-size
Date: Sat, 27 Feb 2021 19:02:13 -0500	[thread overview]
Message-ID: <jwvft1h5d1p.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <jwvr1l15imi.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 27 Feb 2021 16:03:18 -0500")

>>> I see them with 'make bootstrap', and I think they started with:
>>> * lisp/emacs-lisp/cconv.el: Improve line-nb info of unused var warnings
>>> a350ae058c 2021-02-26 20:24:52 -0500
>>> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a350ae058caedcb7be7d332564817954e3624e60
>>
>> I can't reproduce it here, neither with `make bootstrap` nor after `make
>> extraclean`.  Any chance that a5ad6747c9da238bd2bcd335b9744ce9f4972ff1
>> fixed it?
> Oh, wait, no, I see it now, so it's clearly not fixed,

It's a fleeting thing, fairly delicate to catch.
I can now reproduce it and it seems that it's just a "slightly too deep"
recursion when `quail-update-leim-list-file` calls `find-file-noselect`
which ends up loading `vc-git` which in turn loads `diff-mode` and
where the macroexpansion of some pcase macros hits the limit.

I suspect (but have not been able to confirm) that it might be due to the
change in `pcase--if` where we now return `(progn (ignore ,test) ,then)`
instead of just `then`, which causes the macroexpansion of `pcase-let`s
to be slightly more deeply nested.

Then again, I had to increase max_specpdl_size from 1600 to 1740 to get
past that problem, which seems like a higher impact than what I expect
from this little change in `pcase--if`.

In any case, rather than bump the pdl limit, I suggest the patch below,
which completely avoids the need to macroexpand all that code we won't
be using anyway.


        Stefan


diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index e4bdf50f52..a3685b564d 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1312,8 +1312,13 @@ update-leim-list-functions
 
 (defun update-leim-list-file (&rest dirs)
   "Update LEIM list file in directories DIRS."
-  (dolist (function update-leim-list-functions)
-    (apply function dirs)))
+  ;; bug#46818: This `let'-binding is not indispensable, but
+  ;; it reduces the recursion depth during bootstrap (at which
+  ;; point some of the core ELisp files haven't been byte-compiled
+  ;; yet, which causes deeper-than-normal recursion).
+  (let ((vc-handled-backends nil))
+    (dolist (function update-leim-list-functions)
+      (apply function dirs))))
 
 (defvar-local current-input-method nil
   "The current input method for multilingual text.






  parent reply	other threads:[~2021-02-28  0:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-27 18:17 bug#46818: leim bootstrap: Variable binding depth exceeds max-specpdl-size Glenn Morris
2021-02-27 18:34 ` Basil L. Contovounesios
2021-02-27 20:55   ` Stefan Monnier
2021-02-27 21:03     ` Stefan Monnier
2021-02-28  0:01       ` Basil L. Contovounesios
2021-02-28  0:02       ` Stefan Monnier [this message]
2021-02-28  0:22         ` Basil L. Contovounesios
2021-02-28  0:51           ` Stefan Monnier
2021-02-28  2:18             ` Basil L. Contovounesios
2021-02-28  2:31         ` Glenn Morris
2021-02-28  3:42         ` Eli Zaretskii
     [not found]           ` <87wnusnx0n.fsf@gnus.org>
2021-03-01 17:02             ` Stefan Monnier
2021-02-27 18:44 ` Eli Zaretskii
2021-02-27 18:50   ` Basil L. Contovounesios
2021-02-27 18:51     ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvft1h5d1p.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=46818@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --cc=rgm@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).