emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Segfault in etags with default "TAGS" file


From: Bob Rogers
Subject: Segfault in etags with default "TAGS" file
Date: Sat, 23 Aug 2008 16:12:16 -0400

   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
        address@hidden> 

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/

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 via email to

[Prev in Thread] Current Thread [Next in Thread]