public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug corefiles/14983] New: GDB 7.5.1 crash due to NULL pointer reference at -break-insert
@ 2012-12-26 20:13 forum at emblocks dot org
  2012-12-26 20:14 ` [Bug corefiles/14983] " forum at emblocks dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: forum at emblocks dot org @ 2012-12-26 20:13 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=14983

             Bug #: 14983
           Summary: GDB 7.5.1 crash due to NULL pointer reference at
                    -break-insert
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: critical
          Priority: P2
         Component: corefiles
        AssignedTo: unassigned@sourceware.org
        ReportedBy: forum@emblocks.org
    Classification: Unclassified


File: dwarf2read.c
Function:  process_full_comp_unit

Original:

  static_block = end_symtab_get_static_block (highpc + baseaddr, objfile, 0);

  /* If the comp unit has DW_AT_ranges, it may have discontiguous ranges.
     Also, DW_AT_ranges may record ranges not belonging to any child DIEs
     (such as virtual method tables).  Record the ranges in STATIC_BLOCK's
     addrmap to help ensure it has an accurate map of pc values belonging to
     this comp unit.  */

  dwarf2_record_block_ranges (cu->dies, static_block, baseaddr, cu);
  symtab = end_symtab_from_static_block (static_block, objfile,
                                           SECT_OFF_TEXT (objfile), 0);

The pointer static_block can be NULL while iterating through the symbols. this
will cause a crash of GDB.

I have this patched by:

  static_block = end_symtab_get_static_block (highpc + baseaddr, objfile, 0);

  /* If the comp unit has DW_AT_ranges, it may have discontiguous ranges.
     Also, DW_AT_ranges may record ranges not belonging to any child DIEs
     (such as virtual method tables).  Record the ranges in STATIC_BLOCK's
     addrmap to help ensure it has an accurate map of pc values belonging to
     this comp unit.  */

  // NOTE (Gerard#1#): Bug fix!!!!!!
  symtab = NULL; 
  if(static_block ) 
  {
        dwarf2_record_block_ranges (cu->dies, static_block, baseaddr, cu);

        symtab = end_symtab_from_static_block (static_block, objfile,
                                                SECT_OFF_TEXT (objfile), 0);
  }

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-04-25 16:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-26 20:13 [Bug corefiles/14983] New: GDB 7.5.1 crash due to NULL pointer reference at -break-insert forum at emblocks dot org
2012-12-26 20:14 ` [Bug corefiles/14983] " forum at emblocks dot org
2013-03-06 22:02 ` tromey at redhat dot com
2013-03-07  6:44 ` forum at emblocks dot org
2013-03-07  6:46 ` forum at emblocks dot org
2013-03-08 16:03 ` tromey at redhat dot com
2013-04-12 17:44 ` tromey at redhat dot com
2013-04-12 17:45 ` tromey at redhat dot com
2013-04-12 17:46 ` tromey at redhat dot com
2013-04-25 16:25 ` cvs-commit at gcc dot gnu.org
2013-04-25 16:27 ` tromey at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).