unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: agrambot@gmail.com
Cc: gosselmeyer@googlemail.com, 5847-done@debbugs.gnu.org
Subject: bug#5847: [Hubert Gosselmeyer] Re: bug#5847: ETAGS: Segmentation fault, because of incorrect scope presumption
Date: Wed, 31 Aug 2016 18:59:20 +0300	[thread overview]
Message-ID: <83fuplkjzb.fsf@gnu.org> (raw)
In-Reply-To: <838tvrcsnq.fsf@gnu.org> (message from Eli Zaretskii on Sat, 20 Aug 2016 19:27:21 +0300)

> Date: Sat, 20 Aug 2016 19:27:21 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 5847@debbugs.gnu.org, Hubert Gosselmeyer <gosselmeyer@googlemail.com>
> 
> > Date: Sat, 20 Aug 2016 18:55:36 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: 5847@debbugs.gnu.org
> > 
> > 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.
> 
> Actually, one way of avoiding stack overflow would be to use some BFS
> algorithm that allocates memory off the heap.  Patches welcome.

I've done that now and committed the changes on the master branch.
The resulting etags successfully tagged a dozen of large source trees
together, whereas the original version crashed quite quickly.  The
test file posted here also no longer causes a crash.

The non-recursive version is somewhat slower, so patches to speed it
up are welcome.

I'm closing this bug.





  reply	other threads:[~2016-08-31 15:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06 13:44 bug#5847: ETAGS: Segmentation fault, because of incorrect scope presumption Hubert Gosselmeyer
2016-08-14 21:38 ` Alex
2016-08-20  3:32 ` bug#5847: [Hubert Gosselmeyer] " Alex
2016-08-20 15:55   ` Eli Zaretskii
2016-08-20 16:27     ` Eli Zaretskii
2016-08-31 15:59       ` Eli Zaretskii [this message]
2016-08-20 17:57     ` Ivan Shmakov
2016-08-20 18:18       ` Eli Zaretskii
2016-08-20 19:17         ` Ivan Shmakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83fuplkjzb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=5847-done@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    --cc=gosselmeyer@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).