unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* "make tags" segfaults
@ 2002-09-02 12:01 Kai Großjohann
  2002-09-03 11:11 ` Francesco Potorti`
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Großjohann @ 2002-09-02 12:01 UTC (permalink / raw)


For a while now, I've been getting segfaults during "make tags" from
the trunk.  Finally, I'm submitting a backtrace.  (I snarfed the
command line from the output of "make".)

Can anyone reproduce this?  (Just say "make tags".)  What else can I
do to help debug the problem?

grossjoh@lucy> gdb ../lib-src/etags 
GNU gdb 2002-04-01-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux"...
.gdbinit:41: Error in sourced command file:
No symbol "gdb_valbits" in current context.
(gdb) run --include=TAGS-LISP --include=../lwlib/TAGS     --regex='/[  ]*DEFVAR_[A-Z_   (]+"\([^"]+\)"/'          /home-local/grossjoh/work/gnu/emacs/src/[xyzXYZ]*.[hc]  /home-local/grossjoh/work/gnu/emacs/src/[a-wA-W]*.[hc]
Starting program: /home-local/grossjoh/work/gnu/emacs/lib-src/etags --include=TAGS-LISP --include=../lwlib/TAGS     --regex='/[  ]*DEFVAR_[A-Z_   (]+"\([^"]+\)"/'          /home-local/grossjoh/work/gnu/emacs/src/[xyzXYZ]*.[hc]  /home-local/grossjoh/work/gnu/emacs/src/[a-wA-W]*.[hc]

Program received signal SIGSEGV, Segmentation fault.
0x4008d219 in malloc () from /lib/libc.so.6
(gdb) w
Ambiguous command "w": watch, wh, whatis, where, while, while-stepping, winheight, ws.
(gdb) where
#0  0x4008d219 in malloc () from /lib/libc.so.6
#1  0x4008d074 in malloc () from /lib/libc.so.6
#2  0x0805042e in xmalloc (size=20)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:6602
#3  0x0804fcff in savenstr (cp=0x805bdb0 "#define FONT_WIDTH FONT_MAX_WIDTH", 
    len=19) at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:6193
#4  0x0804a374 in pfnote (name=0x0, is_func=0, 
    linestart=0x805bdb0 "#define FONT_WIDTH FONT_MAX_WIDTH", linelen=19, 
    lno=234, cno=8654)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1913
#5  0x0804a2fc in make_tag (name=0x805b670 "FONT_WIDTH", namelen=10, 
    is_func=0, linestart=0x805bdb0 "#define FONT_WIDTH FONT_MAX_WIDTH", 
    linelen=19, lno=234, cno=8654)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1859
#6  0x0804af71 in make_C_tag (isfun=0)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:3038
#7  0x0804b8cd in C_entries (c_ext=4096, inf=0x805b8b0)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:3388
#8  0x0804c525 in default_C_entries (inf=0x805b8b0)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:3836
#9  0x0804a20f in find_entries (inf=0x805b8b0)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1789
#10 0x08049de8 in process_file (fh=0x805b8b0, 
    fn=0x805bbe0 "/home-local/grossjoh/work/gnu/emacs/src/xfaces.c", lang=0x0)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1591
#11 0x08049c82 in process_file_name (
    file=0xbfffc8f6 "/home-local/grossjoh/work/gnu/emacs/src/xfaces.c", 
    lang=0x0) at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1539
#12 0x08049701 in main (argc=180, argv=0xbfffc384)
    at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1222
(gdb) 


kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "make tags" segfaults
  2002-09-02 12:01 "make tags" segfaults Kai Großjohann
@ 2002-09-03 11:11 ` Francesco Potorti`
  2002-09-03 11:57   ` Kai Großjohann
  0 siblings, 1 reply; 4+ messages in thread
From: Francesco Potorti` @ 2002-09-03 11:11 UTC (permalink / raw)
  Cc: emacs-devel

   (gdb) run --include=TAGS-LISP --include=../lwlib/TAGS     --regex='/[  ]*DEFVAR_[A-Z_   (]+"\([^"]+\)"/'          /home-local/grossjoh/work/gnu/emacs/src/[xyzXYZ]*.[hc]  /home-local/grossjoh/work/gnu/emacs/src/[a-wA-W]*.[hc]
   Starting program: /home-local/grossjoh/work/gnu/emacs/lib-src/etags --include=TAGS-LISP --include=../lwlib/TAGS     --regex='/[  ]*DEFVAR_[A-Z_   (]+"\([^"]+\)"/'          /home-local/grossjoh/work/gnu/emacs/src/[xyzXYZ]*.[hc]  /home-local/grossjoh/work/gnu/emacs/src/[a-wA-W]*.[hc]
   
   Program received signal SIGSEGV, Segmentation fault.
   0x4008d219 in malloc () from /lib/libc.so.6
   (gdb) w
   Ambiguous command "w": watch, wh, whatis, where, while, while-stepping, winheight, ws.
   (gdb) where
   #0  0x4008d219 in malloc () from /lib/libc.so.6
   #1  0x4008d074 in malloc () from /lib/libc.so.6
   #2  0x0805042e in xmalloc (size=20)
       at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:6602

This should mean that there has been memory corruption in the malloc
structures :-(

I cannot reproduce the bug, and none of my tests fail.  Moreover, I
cannot easily deduce where the memory corruption happens.  When
developing, I usually instrument etags with a small checkmalloc library.
If you can use a malloc checking library yourself, please try to do so
and report the results to me.

Else, I can send you the two source files needed for that library and
the small modifications to the Makefile for building and running etags
with malloc instrumentation.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "make tags" segfaults
  2002-09-03 11:11 ` Francesco Potorti`
@ 2002-09-03 11:57   ` Kai Großjohann
  2002-09-03 13:41     ` Francesco Potorti`
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Großjohann @ 2002-09-03 11:57 UTC (permalink / raw)
  Cc: emacs-devel

Francesco Potorti` <pot@gnu.org> writes:

> I cannot reproduce the bug, and none of my tests fail.  Moreover, I
> cannot easily deduce where the memory corruption happens.  When
> developing, I usually instrument etags with a small checkmalloc library.
> If you can use a malloc checking library yourself, please try to do so
> and report the results to me.

I tried electric fence and got the following results:

/----
| [New Thread 1024 (LWP 15303)]
| 
|   Electric Fence 2.1 Copyright (C) 1987-1998 Bruce Perens.
| 
| ElectricFence Aborting: free(40172ffc): address not from malloc().
| 
| Program received signal SIGILL, Illegal instruction.
| [Switching to Thread 1024 (LWP 15303)]
| 0x4004c781 in kill () from /lib/libc.so.6
| (gdb) where
| #0  0x4004c781 in kill () from /lib/libc.so.6
| #1  0x40020eb6 in EF_Abort () from /usr/lib/libefence.so.0
| #2  0x400207c4 in free () from /usr/lib/libefence.so.0
| #3  0x0804a4b0 in free_tree (np=0x4018afd8)
|     at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1931
| #4  0x08049f26 in process_file (fh=0x40176e94, 
|     fn=0x40174fd0 "/home-local/grossjoh/work/gnu/emacs/src/xdisp.c", lang=0x0)
|     at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1619
| #5  0x08049d72 in process_file_name (
|     file=0xbfffc8c5 "/home-local/grossjoh/work/gnu/emacs/src/xdisp.c", 
|     lang=0x0) at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1539
| #6  0x080497f1 in main (argc=180, argv=0xbfffc374)
|     at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1222
| (gdb) 
\----

However, I don't know what I'm doing, so maybe the above is totally
misleading or wrong...

Is anyone else getting the same problem, or is it just me?

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "make tags" segfaults
  2002-09-03 11:57   ` Kai Großjohann
@ 2002-09-03 13:41     ` Francesco Potorti`
  0 siblings, 0 replies; 4+ messages in thread
From: Francesco Potorti` @ 2002-09-03 13:41 UTC (permalink / raw)
  Cc: emacs-devel

   | #2  0x400207c4 in free () from /usr/lib/libefence.so.0
   | #3  0x0804a4b0 in free_tree (np=0x4018afd8)
   |     at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1931
   | #4  0x08049f26 in process_file (fh=0x40176e94, 
   |     fn=0x40174fd0 "/home-local/grossjoh/work/gnu/emacs/src/xdisp.c", lang=0x0)
   |     at /home-local/grossjoh/work/gnu/emacs/lib-src/etags.c:1619

Hey!  That is enough for me, thanks.  I did not have double free check
in my chkmalloc lib, I added that and now I can reproduce the problem!

I will correct it ASAP.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-09-03 13:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-02 12:01 "make tags" segfaults Kai Großjohann
2002-09-03 11:11 ` Francesco Potorti`
2002-09-03 11:57   ` Kai Großjohann
2002-09-03 13:41     ` Francesco Potorti`

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).