Subject: bug#27779: 26.0.50: read -- Re-entering top level after C stack overflow

From: [email-masked]
Date: Sat, 22 Jul 2017 13:23:23 -0400

Keith David Bershatsky <[email-masked]> writes:

> Setting `ulimit -S -s unlimited` from the terminal prior to launching
> the GUI version of Emacs 26.0.50 from the same terminal session on OSX
> 10.6.8 does NOT resolve/fix the "Re-entering top level after C stack
> overflow" that appears in the *Messages* buffer.  :(

Hmm, the trick works on GNU/Linux.

>
> Emacs 25.2.1, on the other hand, IS able to successfully handle the following example:

Yes, it's a bit strange that on 26.0.50 prin1-to-string can go up to
almost 60000, while `read' gives up at 4600.  By the way, for future
reference, I suggest adding a length count to the "Success!" output; I
got confused for a bit when seeing C-M-x easily succeed up to very large
depths (which is because it binds print-level to a small value).

(let* ((print-circle t)
       (max-lisp-eval-depth most-positive-fixnum)
       (max-specpdl-size most-positive-fixnum)
       (deep-object (make-deep-object 6000))
       (string (prin1-to-string deep-object))
       (result (read string)))
  (when result
    (message "Success! (%d)" (length string))))