gdb/2093: gdb gets a segmentation violation when looking up functions

john@jupiter.com john@jupiter.com
Thu Mar 2 19:58:00 GMT 2006


>Number:         2093
>Category:       gdb
>Synopsis:       gdb gets a segmentation violation when looking up functions
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 02 19:58:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     John Klingler
>Release:        6.3
>Organization:
>Environment:
Dual Xeon, Red Hat Linux 2.6.11-1.1369_FC4 SMP
>Description:
Running gdb 6.3 under ddd 3.3.10, Using Lookup to find a function causes gdb to get a segmentation violation.

The code being debugged was a driver module written in C, compiled with gcc 4.0.0.

I traced the problem to find_line_pc_range in symtab.c. It was trying to xfree an uninitialized pointer with a value of 0x01.
>How-To-Repeat:
It always happens in some programs but not in others, sorry.
>Fix:
In symtab.c:
change line 2418 from
  CORE_ADDR *pc_list;
to
  CORE_ADDR *pc_list = (CORE_ADDR*)0;

Change lines 2429 to 2432 from
  if (startaddr == 0)
    startaddr = pc_list[0];

  xfree (pc_list);
to
  if(pc_list)
  {
    if (startaddr == 0)
      startaddr = pc_list[0];

    xfree (pc_list);
  }

NOTE: xfree might be all right if pc_list == 0, I didn't try that. It definitely is not all right if pc_list == 1.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gdb-prs mailing list