Dear Paul and Noam: I have determined that bug #27571 was introduced on November 19, 2016 with commit c61ee94959ba96b2a327df0684593f7e569e30be. The following patch to the Emacs 26 branch as of today (01/08/2018) reverses the commit and enables the test below to be completed successfully. [FYI: I am on OSX 10.6.8 and am manually increasing the stack limit with `ulimit -S -s unlimited` so that I can have rather large custom undo-tree histories.] (require 'cl-lib) (defun make-deep-object (depth) (let ((obj 1)) (while (> (cl-decf depth) 0) (setq obj (vector (list obj)))) obj)) ;;; STACK OVERFLOW: problem with `prin1-to-string' ;;; The bug was introduced on November 19, 2016 with ;;; commit: c61ee94959ba96b2a327df0684593f7e569e30be (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))) (when string (message "Bug #27571: Success! (%d)" (length string))))