Subject: bug#31995: 26.1; Condition-case failed to catch error

From: Paul Eggert <[email-masked]>
Date: Thu, 12 Jul 2018 22:43:38 -0500

On 07/12/2018 07:29 PM, Sheng Yang (杨圣) wrote:
> the buffer is totally a waste of space when read1 is dealing with
> everything ("[", "]", "(", ")", "#", "=", numbers, etc.) other than
> the name of a symbol (usually tens of characters) or a string
Thanks for reporting this. I attempted to work around the immediate
problem by installing the attached into the emacs-26 branch. Although
this doesn't address the overall problem of stack overflow, that is less
pressing.
>From b38b91a83491b6812e8267d0247355f0e8e3e189 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Thu, 12 Jul 2018 20:23:07 -0700
Subject: [PATCH] Lessen stack consumption in recursive read1

* src/lread.c (read1): Shrink local buffer size from
MAX_ALLOCA to 128 (Bug#31995).
---
 src/lread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lread.c b/src/lread.c
index 72523c057f..d5ba48a170 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2677,7 +2677,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
   int c;
   bool uninterned_symbol = false;
   bool multibyte;
-  char stackbuf[MAX_ALLOCA];
+  char stackbuf[128];  /* Small, as read1 is recursive (Bug#31995).  */
   current_thread->stack_top = stackbuf;
 
   *pch = 0;
-- 
2.17.1