Subject: Re: bug#42931: 27.1; json-pretty-print-buffer on ~2MB line causes core dump

From: Eli Zaretskii <[email-masked]>
Date: Tue, 25 Aug 2020 09:12:58 +0300

> Cc: [email-masked], Lars Ingebrigtsen <[email-masked]>,
>  Eli Zaretskii <[email-masked]>, Philipp Stephani <[email-masked]>,
>  Bruno Haible <[email-masked]>
> From: Paul Eggert <[email-masked]>
> Date: Mon, 24 Aug 2020 16:46:01 -0700
> 
> In theory even O(log N) might not be good enough if Emacs has a tiny stack and a 
> huge buffer, but I doubt whether this is of practical concern.

What about "normal" Emacs builds?  They usually have between 2MB and
8MB of stack.  Should we worry about stack overflow in these cases?
Maybe it is worth to add a stack-overflow protection to diffseq.h
anyway?  Almost anything is better than a segfault.

Thanks.