all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Segfault in etags with default "TAGS" file
@ 2008-08-23 20:12 Bob Rogers
  0 siblings, 0 replies; only message in thread
From: Bob Rogers @ 2008-08-23 20:12 UTC (permalink / raw)
  To: emacs-devel

[-- 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
      {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-23 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-23 20:12 Segfault in etags with default "TAGS" file Bob Rogers

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.