all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
To: emacs-devel@gnu.org
Subject: Segfault in etags with default "TAGS" file
Date: Sat, 23 Aug 2008 16:12:16 -0400	[thread overview]
Message-ID: <18608.28448.772856.47216@rgrjr.rgrjr.dyndns.org> (raw)

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 880 bytes --]

   Doing "make TAGS" in current trunk on my GNU/Linux system (openSUSE
10.2 with Linux 2.6.18.2, gcc 4.1.3, glibc 2.5, running on an AMD Athlon
XP 2500+) fails with the following segfault:

	cd src; make tags
	make[1]: Entering directory `/usr/src/emacs/src'
	../lib-src/etags --include=TAGS-LISP --include=../lwlib//TAGS --regex='/[ 	]*DEFVAR_[A-Z_ 	(]+"\([^"]+\)"/' /usr/src/emacs/src/[xyzXYZ]*.[hc] /usr/src/emacs/src/[a-wA-W]*.[hc]
	make[1]: *** [TAGS] Segmentation fault
	make[1]: Leaving directory `/usr/src/emacs/src'
	make: *** [TAGS] Error 2
	rogers@rgr> 

If I revert the hunk to revision 3.89 of lib-src/etags.c that affects
line 1267, it works again.  On the theory that my system doesn't permit
writing constant strings, I produced the attached patch, which fixes it
for me (and seems a tad cleaner in any case).

					-- Bob Rogers
					   http://rgrjr.dyndns.org/


[-- Attachment #2: Type: text/plain, Size: 1107 bytes --]

Index: lib-src/etags.c
===================================================================
RCS file: /sources/emacs/emacs/lib-src/etags.c,v
retrieving revision 3.89
diff -c -r3.89 etags.c
*** lib-src/etags.c	16 Aug 2008 23:57:41 -0000	3.89
--- lib-src/etags.c	23 Aug 2008 20:03:06 -0000
***************
*** 1250,1257 ****
        /* NOTREACHED */
      }
  
-   if (tagfile == NULL)
-     tagfile = CTAGS ? "tags" : "TAGS";
    cwd = etags_getcwd ();	/* the current working directory */
    if (cwd[strlen (cwd) - 1] != '/')
      {
--- 1250,1255 ----
***************
*** 1260,1267 ****
        free (oldcwd);
      }
    /* Relative file names are made relative to the current directory. */
!   if (streq (tagfile, "-")
!       || strneq (tagfile, "/dev/", 5))
      tagfiledir = cwd;
    else
      {
--- 1258,1267 ----
        free (oldcwd);
      }
    /* Relative file names are made relative to the current directory. */
!   if (tagfile == NULL)
!     tagfile = CTAGS ? "tags" : "TAGS";
!   else if (streq (tagfile, "-")
! 	   || strneq (tagfile, "/dev/", 5))
      tagfiledir = cwd;
    else
      {

                 reply	other threads:[~2008-08-23 20:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=18608.28448.772856.47216@rgrjr.rgrjr.dyndns.org \
    --to=rogers-emacs@rgrjr.dyndns.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.