From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#46818: leim bootstrap: Variable binding depth exceeds max-specpdl-size Date: Sat, 27 Feb 2021 19:02:13 -0500 Message-ID: References: <87blc52wc2.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11969"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Glenn Morris , 46818@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 28 01:03:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lG9YD-00031V-VX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Feb 2021 01:03:10 +0100 Original-Received: from localhost ([::1]:54308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lG9YD-0001R0-1g for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Feb 2021 19:03:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lG9Y6-0001Qs-Hy for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2021 19:03:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34015) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lG9Y6-0003Yi-9U for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2021 19:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lG9Y6-0003JD-6I for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2021 19:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Feb 2021 00:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46818 X-GNU-PR-Package: emacs Original-Received: via spool by 46818-submit@debbugs.gnu.org id=B46818.161447054712660 (code B ref 46818); Sun, 28 Feb 2021 00:03:02 +0000 Original-Received: (at 46818) by debbugs.gnu.org; 28 Feb 2021 00:02:27 +0000 Original-Received: from localhost ([127.0.0.1]:45559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lG9XX-0003I8-Bl for submit@debbugs.gnu.org; Sat, 27 Feb 2021 19:02:27 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6039) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lG9XV-0003Hv-Pt for 46818@debbugs.gnu.org; Sat, 27 Feb 2021 19:02:26 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 36A47441B6E; Sat, 27 Feb 2021 19:02:20 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 42654441B6B; Sat, 27 Feb 2021 19:02:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1614470534; bh=aLVWfVxmP2sM8tRe6vqwNXhWP1VG2WwAc/yJpLPsLi8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PCFB4/chmC0P5YByYRMKwCHzsw8I2rMP/0jdm8r9M5hBBB51CWUXN+Fffz8h7S+CK N1ooriCLPAfZhXsfL2r6E7VZCgP8tknXmqjRipantwW+E+kdI562iyTl/ZfB3ieDYs 9aiHoiy/YC2hdQT0PMHN/GiHQdGV9KtRFrXJWkqwf2ouOKw33+0H6/zmT3S1+tFhfB T8aSr8CWH7squarW08LOG8otnfMshbU5euoFZN+poqr4gLassU7oCx5Xg+9Ha2U+HN wF+3scszqgro+9kf3bX0Ks0iet+o7uA+NXP9v15q16vhGEEHP9LLxrjgZfIHfEkLR/ uJR7VtdeDHOZA== Original-Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0F5FE12023F; Sat, 27 Feb 2021 19:02:14 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Sat, 27 Feb 2021 16:03:18 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:200997 Archived-At: >>> 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.