unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 36216@debbugs.gnu.org
Subject: bug#36216: 27.0.50; Variable binding depth exceeds max-specpld-size during bootstrap
Date: Sun, 16 Jun 2019 07:57:20 +0200	[thread overview]
Message-ID: <CAAeL0SSeh5-MZBnFC-BZaAxgmTmv0PJ4j0kP4V-WL2WmNzVXcw@mail.gmail.com> (raw)
In-Reply-To: <83blyzw3zs.fsf@gnu.org>

> Well, does the same command fails in the same way when invoked from
> the command line?

Once I remove the .elc files, any invocation of

./temacs --batch

(with or without explicitly loading loadup.el or passing the --temacs
arg) produces the same error, because it automatically loads
loadup.el.

> If so, just invoke it with the appropriate --eval
> argument that increases the value of max-specpdl-size.

AFAICS, setting max-specpdl-size in an --eval doesn't work, because
temacs loads loadup.el before processing the --eval. If I instrument
loadup.el to show its value, I get:

$ ./temacs --eval "(setq max-specpdl-size 1450)" --batch
Loading loadup.el (source)...
> (loadup.el) max-specpdl-size = 1300
dump mode: nil

Obviously, the problem disappears if I bind max-specpdl-size to a
bigger value around the load of cl-generic, or if I set it explicitly
in the conditional code at the beginning of loadup.el that also sets
max-lisp-eval-depth

(if (or (member dump-mode '("bootstrap" "pbootstrap"))
;; FIXME this is irritatingly fragile.
        (and (stringp (nth 4 command-line-args))
             (string-match "^unidata-gen\\(\\.elc?\\)?$"
                           (nth 4 command-line-args)))
        (member (nth 7 command-line-args) '("unidata-gen-file"
                                            "unidata-gen-charprop"))
        (null dump-mode))
    (progn
      [...etc etc...]
      (setq max-specpdl-size 1450)   ;;; <=== THIS WORKS
      ;; During bootstrapping the byte-compiler is run interpreted
      ;; when compiling itself, which uses a lot more stack
      ;; than usual.
      (setq max-lisp-eval-depth 2200)))

I wonder if it wouldn't just make sense to borrow the same trick
loadup.el uses with pcase.el to disable eager macroexpansion, i.e.,
something like

diff --git i/lisp/loadup.el w/lisp/loadup.el
index 67e8aa7d40..9f08b19043 100644
--- i/lisp/loadup.el
+++ w/lisp/loadup.el
@@ -246,7 +246,10 @@
 (load "language/cham")

 (load "indent")
-(load "emacs-lisp/cl-generic")
+(if (byte-code-function-p (symbol-function 'macroexpand-all))
+    (load "emacs-lisp/cl-generic")
+  (let ((macroexp--pending-eager-loads '(skip)))
+    (load "emacs-lisp/cl-generic")))
 (load "frame")
 (load "startup")
 (load "term/tty-colors")





  reply	other threads:[~2019-06-16  5:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-15  0:53 bug#36216: 27.0.50; Variable binding depth exceeds max-specpld-size during bootstrap Juanma Barranquero
2019-06-15  6:29 ` Eli Zaretskii
2019-06-15 10:00   ` Juanma Barranquero
2019-06-15 10:13     ` Eli Zaretskii
2019-06-16  5:57       ` Juanma Barranquero [this message]
2019-06-16 12:01         ` Juanma Barranquero
2019-06-16 14:04           ` Eli Zaretskii
2019-06-16 14:17             ` Juanma Barranquero
2019-06-16 14:20               ` Eli Zaretskii
2019-06-16 19:34                 ` Stefan Monnier
2019-06-16 19:49                   ` Juanma Barranquero
2019-06-16 21:22                     ` Juanma Barranquero
2019-06-27 20:17                       ` Juanma Barranquero
2019-06-16 21:32                     ` Stefan Monnier
2019-06-15 11:22 ` Lars Ingebrigtsen
2019-06-16  6:01   ` Juanma Barranquero

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=CAAeL0SSeh5-MZBnFC-BZaAxgmTmv0PJ4j0kP4V-WL2WmNzVXcw@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=36216@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 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).