This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
symtab/1439: solaris/gcc/dwarf-2 symbol table results in gdb core dump
- From: larue at cadence dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 31 Oct 2003 21:18:32 -0000
- Subject: symtab/1439: solaris/gcc/dwarf-2 symbol table results in gdb core dump
- Reply-to: larue at cadence dot com
>Number: 1439
>Category: symtab
>Synopsis: solaris/gcc/dwarf-2 symbol table results in gdb core dump
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 31 21:28:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Woody LaRue
>Release: 6.0
>Organization:
>Environment:
Solaris 7
g++ 3.2 configured to produce symbol table in dwarf-2
>Description:
I get a gdb core dump when loading the symbol table produced by g++ 3.2 configured with dwarf-2 on solaris 7.
In 6.0, I traced the problem to elfread.c line 401.
size = (sizeof (struct stab_section_info)
+ (sizeof (CORE_ADDR)
* (max_index - 1)));
The calculated size is too small, and by adding debuging statements to the code, I was able to verify that we were writing past the end of the array.
I believe that the correct code is:
size = (sizeof (struct stab_section_info)
+ (sizeof (CORE_ADDR)
* max_index));
>How-To-Repeat:
the nscsim test debug_ncelab shows this problem, but unfortunately the test is not easy to package up.
>Fix:
Change line 401 of elfread.c from
size = (sizeof (struct stab_section_info)
+ (sizeof (CORE_ADDR)
* (max_index - 1)));
to
size = (sizeof (struct stab_section_info)
+ (sizeof (CORE_ADDR)
* max_index));
>Release-Note:
>Audit-Trail:
>Unformatted: