Subject: Re: bug#5847: [Hubert Gosselmeyer] Re: bug#5847: ETAGS: Segmentation fault, because of incorrect scope presumption

From: Eli Zaretskii <[email-masked]>
Date: Sat, 20 Aug 2016 18:55:36 +0300

> From: Alex <[email-masked]>
> Date: Fri, 19 Aug 2016 21:32:25 -0600
> 
> From: Hubert Gosselmeyer <[email-masked]>
> Date: Thu, 18 Aug 2016 14:15:46 +0200
> Subject: Re: bug#5847: ETAGS: Segmentation fault, because of incorrect scope presumption
> To: Alex <[email-masked]>
> 
> I rechecked the issue with my new hardware (got a new laptop meanwhile). 
> The issue does not occur for the files attached on the bug report anymore.
> 
> As I suspect that it has something to do with large memory allocation, I produced some larger files
> with an python script. I tested it on my machine still with etags (GNU Emacs 23.1) and gave the files
> to a collegue, who tested it with etags (GNU Emacs 24.3). On both etags crashed for test_seg.c. 

That file blows up the runtime stack because of recursive calls to
put_entries when etags writes out the tree of nodes it collected.
Since recovery from stack overflow is inherently OS dependent and
unreliable, I don't see what we can do in this case.  Even if we do
detect the upcoming stack overflow, the only thing we can do is print
an error message and quit.  A workaround is to build Etags with a
larger stack.

Thanks.