From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Daniel_Bergstr=F6m?= Newsgroups: gmane.emacs.bugs Subject: BUG: etags segfaults Date: Wed, 26 Mar 2003 17:52:30 +0100 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3E81DACE.803@gis.ericsson.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030102070606040906080006" X-Trace: main.gmane.org 1048697905 4880 80.91.224.249 (26 Mar 2003 16:58:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 26 Mar 2003 16:58:25 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 26 17:58:24 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18yEEJ-0001GV-00 for ; Wed, 26 Mar 2003 17:58:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18yEDa-00036c-01 for gnu-bug-gnu-emacs@m.gmane.org; Wed, 26 Mar 2003 11:57:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18yED2-0002gZ-00 for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2003 11:57:04 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18yEAb-0001OK-00 for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2003 11:54:34 -0500 Original-Received: from penguin-ext.wise.edt.ericsson.se ([193.180.251.47] helo=penguin.wise.edt.ericsson.se) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18yE8i-0000GZ-00 for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2003 11:52:37 -0500 Original-Received: from esealnt611.al.sw.ericsson.se (alteon-nat4.sw.ericsson.se [153.88.254.121])ESMTP id h2QGqUHQ017577 for ; Wed, 26 Mar 2003 17:52:30 +0100 (MET) Original-Received: from gis.ericsson.se (lm6042.lmera.ericsson.se [150.132.106.42]) by Mail Service Version 5.5.2655.55) id HMMSXCS9; Wed, 26 Mar 2003 17:52:30 +0100 X-Sybari-Trust: 7dbb5761 d6a25af5 c6a4e380 00000138 User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.2.1) Gecko/20030107 X-Accept-Language: sv, en-us, en Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4654 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4654 This is a multi-part message in MIME format. --------------030102070606040906080006 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello! In Emacs 21.3 the etags utility seg. faults. To recreate the error you need to do the following steps: * create a file named t.erl and add the following two lines: -module(t). -define(). * Then we execute the etags command: etags -o TAGS t.erl This results in a segfault and a core dumped. The reason to the segfault was that in the routine erlang_attribute() it calculates the length of the string between ( and ) to be -1. The if statement only checks if the value isn't 0 to continue working with the string, while it should only continue if its a possitive value greather then 0. The patch attached should correct this problem. Cheers, Daniel --------------030102070606040906080006 Content-Type: text/plain; name="emacs-21.3.etags.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="emacs-21.3.etags.patch" --- emacs-21.3/lib-src/etags.c.org Wed Mar 26 17:08:34 2003 +++ emacs-21.3/lib-src/etags.c Wed Mar 26 17:09:43 2003 @@ -4969,7 +4969,7 @@ { pos = skip_spaces (s + pos) - s; len = erlang_atom (s, pos); - if (len != 0) + if (len > 0) pfnote (savenstr (& s[pos], len), TRUE, s, pos + len, lineno, linecharno); } --------------030102070606040906080006 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Bug-gnu-emacs mailing list Bug-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs --------------030102070606040906080006--