Bug 9218 - gdb crash when reading binary informations
Summary: gdb crash when reading binary informations
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 6.3
: P1 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-11 14:18 UTC by fabrice.ilponse
Modified: 2011-03-28 19:24 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fabrice.ilponse 2006-04-11 14:18:01 UTC
[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.
Comment 1 fabrice.ilponse 2006-04-11 14:18:01 UTC
Fix:
check lh->include_dirs!=NULL before using it
Comment 2 Tom Tromey 2011-03-28 19:24:01 UTC
All callers of dwarf_decode_lines now check whether the line header
is NULL.  So, I think this was fixed.