[Converted from Gnats 2113] core dump: in some .c files, lh->include_dirs is used without testing lh->include_dirs==NULL gdb output: Loaded symbols for /usr/lib/64/libthread_db.so.1 #0 0x0000000100158f40 in dwarf_decode_lines (lh=0x1008ee350, comp_dir=0x0, abfd=0x1004d59c0, cu=0xffffffff7fffbf70, pst=0x1011c2060) at dwarf2read.c:6560 6560 dir = lh->include_dirs[fe->dir_index - 1]; Setting up the environment for debugging gdb. Breakpoint 1 at 0x10004fc94: file utils.c, line 850. Breakpoint 2 at 0x10008fc5c: file cli/cli-cmds.c, line 193. Release: gdb 6.3 Environment: Solaris 5.9 64bit gcc version 3.3.1 to build the binary to debug generating the gdb core How-To-Repeat: perhaps try to debug a gcc 3.3.1 binary NB: this bug was also present in gdb 6.2.
Fix: check lh->include_dirs!=NULL before using it
All callers of dwarf_decode_lines now check whether the line header is NULL. So, I think this was fixed.