GNU bug report logs - #42931
27.1; json-pretty-print-buffer on ~2MB line causes core dump

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Wed, 19 Aug 2020 13:52:02 UTC

Severity: normal

Found in version 27.1

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 42931-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42931-done <at> debbugs.gnu.org, larsi <at> gnus.org, bruno <at> clisp.org,
 p.stephani2 <at> gmail.com, psainty <at> rcon.net.nz
Subject: Re: bug#42931: 27.1; json-pretty-print-buffer on ~2MB line causes
 core dump
Date: Tue, 25 Aug 2020 11:19:04 -0700
On 8/24/20 11:12 PM, Eli Zaretskii wrote:
> What about "normal" Emacs builds?  They usually have between 2MB and
> 8MB of stack.  Should we worry about stack overflow in these cases?

No. On x86-64 Ubuntu 18.04.5 each recursion level consumes 304 bytes. Dividing 2 
MB by 304 gives you 6578 stack frames, which means the algorithm could handle a 
vector of 2**6578 entries, which can't exist anywhere in the known physical 
universe.

On real machines it'd have to be reeeeally tiny stack for this recursion to be a 
significant problem now, so tiny that Emacs would crash for countless other 
reasons. I'll take the liberty of closing the bug report.




This bug report was last modified 4 years and 268 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.