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 #17 received at 42931 <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Phil Sainty <psainty <at> orcon.net.nz>, 42931 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#42931: 27.1; json-pretty-print-buffer on ~2MB line causes
 core dump
Date: Thu, 20 Aug 2020 15:26:06 +0200
Am Do., 20. Aug. 2020 um 15:23 Uhr schrieb Lars Ingebrigtsen <larsi <at> gnus.org>:
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > looks like stack overflow?  I guess the recursive nature of compareseq
> > is got to cause this at some point?
>
> Yup.
>
> I'm not sure what to do about it, though.  One easy way to "fix this"
> would be to not use replace-region-contents in json-pretty-print if the
> region is very large...  but that's kinda just wallpapering over the
> problem.
>
> replace-region-contents itself could decide to not do all its fancy
> stuff if the region is very large, and just replace the contents in the
> normal way instead?


I guess the underlying function (compareseq) should protect against
unbounded recursion and fall back to a more coarse diff if necessary.




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.