From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83fuplkjzb.fsf@gnu.org> References: <87inuwf73q.fsf@gmail.com> <83d1l3cu4n.fsf@gnu.org> <838tvrcsnq.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1472659366 3830 195.159.176.226 (31 Aug 2016 16:02:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 Aug 2016 16:02:46 +0000 (UTC) Cc: gosselmeyer@googlemail.com, 5847-done@debbugs.gnu.org To: agrambot@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 31 18:02:39 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bf7yI-0000BF-Cn for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Aug 2016 18:02:38 +0200 Original-Received: from localhost ([::1]:54798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf7yC-0008Of-2z for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Aug 2016 12:02:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf7vr-0006eT-GG for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2016 12:00:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bf7vn-0003IV-1L for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2016 12:00:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf7vm-0003IR-Ve for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2016 12:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bf7vm-00029g-QA for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2016 12:00:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Aug 2016 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 5847 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 5847@debbugs.gnu.org, eliz@gnu.org, gosselmeyer@googlemail.com Original-Received: via spool by 5847-done@debbugs.gnu.org id=D5847.14726591838221 (code D ref 5847); Wed, 31 Aug 2016 16:00:02 +0000 Original-Received: (at 5847-done) by debbugs.gnu.org; 31 Aug 2016 15:59:43 +0000 Original-Received: from localhost ([127.0.0.1]:45602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bf7vP-00028T-5s for submit@debbugs.gnu.org; Wed, 31 Aug 2016 11:59:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bf7vK-00028D-4D for 5847-done@debbugs.gnu.org; Wed, 31 Aug 2016 11:59:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bf7vD-00037O-JQ for 5847-done@debbugs.gnu.org; Wed, 31 Aug 2016 11:59:28 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf7v9-00035c-PO; Wed, 31 Aug 2016 11:59:23 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3187 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bf7v7-0006mK-T9; Wed, 31 Aug 2016 11:59:22 -0400 In-reply-to: <838tvrcsnq.fsf@gnu.org> (message from Eli Zaretskii on Sat, 20 Aug 2016 19:27:21 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122810 Archived-At: > Date: Sat, 20 Aug 2016 19:27:21 +0300 > From: Eli Zaretskii > Cc: 5847@debbugs.gnu.org, Hubert Gosselmeyer > > > Date: Sat, 20 Aug 2016 18:55:36 +0300 > > From: Eli Zaretskii > > 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.