[gnu.gdb.bug] gdb 3.2 aborts while reading symbol data generated by g++ 1.35.1

rich@RICE.EDU (Richard Murphey) (08/10/89)

Configuration: Sun 3/260 Sun OS 3.5, gcc 1.35, gdb 3.2, gcc 1.35.1-

Problem: gdb aborts while reading the symbol table of input.c (from
groff) compiled by g++ after the message:

       Reading in symbols for input.c...Invalid symbol data: bad
	 structure-type format at symtab pos 721.

gdb 3.2 is unable to recover from this error and aborts.  In the
transcript below, the mh_alloc member of the mhead structure is
neither ISALLOC or ISFREE.  Any guidance on how to track this down
would be most welcome!  A transcript of the session using gdb 3.2 to
debug gdb 3.2 follows.  Any pointers on how to find out what is wrong
with the g++ generated symbol table would also be very helpful. :-)

Thanks,
Richard-Murphey@Rice.edu       Electrical & Computer Engineering Dept.

================================================================
Current directory is /kappa/rich/pub/dist-gdb/
GDB 3.2, Copyright (C) 1988 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /kappa/rich/pub/dist-gdb/gdb...done.
Setting up the environment for debugging gdb.
Reading in symbols for main.c...done.
Reading in symbols for blockframe.c...done.
Reading in symbols for findvar.c...done.
Reading in symbols for valops.c...done.
Reading in symbols for infrun.c...done.
Reading in symbols for remote.c...done.
Reading in symbols for utils.c...done.
Breakpoint 1 at 0x2802a: file utils.c, line 274.
Breakpoint 2 at 0x351e: file main.c, line 964.
Type "help" for a list of commands.
(top-gdb) cd ../groff
Working directory /kappa/rich/pub/groff.
(top-gdb) run groff
Starting program: /kappa/rich/pub/dist-gdb/gdb groff
GDB 3.2, Copyright (C) 1988 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /kappa/rich/pub/groff/groff...done.
Type "help" for a list of commands.
(gdb) br main
Reading in symbols for input.c...Invalid symbol data: bad structure-type format at symtab pos 721.

Bpt 1, fatal (string=(char *) 0x78ab7 "free: Called with bad argument\n", arg=2) (utils.c line 275)
(top-gdb) where
#0  fatal (string=(char *) 0x78ab7 "free: Called with bad argument\n", arg=2) (utils.c line 275)
#1  0x373f0 in free (...) (...)
#2  0x1b660 in really_free_pendings (...) (...)
#3  0x27cc2 in do_cleanups (old_chain=(struct cleanup *) 0x0) (utils.c line 85)
#4  0x2156 in return_to_top_level () (main.c line 165)
#5  0x28018 in error (string=(char *) 0x68b96 "Invalid symbol data: bad structure-type format at symtab pos %d.", arg1=721, arg2=2, arg3=251232556) (utils.c line 263)
#6  0x211d4 in read_struct_type (...) (...)
#7  0x20c6a in read_type (...) (...)
#8  0x20174 in define_symbol (...) (...)
#9  0x1f39c in process_one_symbol (...) (...)
#10 0x1ee32 in read_ofile_symtab (...) (...)
#11 0x1e830 in psymtab_to_symtab_1 (...) (...)
#12 0x1eb5a in psymtab_to_symtab (...) (...)
#13 0x17894 in lookup_symbol (...) (...)
#14 0x18a44 in decode_line_1 (...) (...)
#15 0x6178 in break_command_1 (...) (...)
#16 0x63be in break_command (...) (...)
#17 0x2b36 in execute_command (p=(char *) 0x89c13 "main", from_tty=1) (main.c line 481)
#18 0x2c2e in command_loop () (main.c line 507)
#19 0x2a28 in main (argc=2, argv=(char **) 0xefffd5c, envp=(char **) 0xefffd68) (main.c line 434)
Reading in symbols for malloc.c...done.
#1  0x373f0 in free (mem=(char *) 0x13b310 "") (malloc.c line 566)
(top-gdb) list
561	    if (p -> mh_alloc != ISALLOC)
562	      {
563		if (p -> mh_alloc == ISFREE)
564		  botch ("free: Called with already freed block argument\n");
565		else
566		  botch ("free: Called with bad argument\n");
567	      }
568	
569	    ASSERT (p -> mh_magic4 == MAGIC4);
570	    ap += p -> mh_nbytes;
(top-gdb) p *p
$1 = {mh_alloc = 0 '\000', mh_index = 0 '\000', mh_size = 19, mh_nbytes = 3004694528, mh_magic4 = 1}
(top-gdb) 
================================================================