public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "forum at emblocks dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug corefiles/14983] New: GDB 7.5.1 crash due to NULL pointer reference at -break-insert
Date: Wed, 26 Dec 2012 20:13:00 -0000	[thread overview]
Message-ID: <bug-14983-4717@http.sourceware.org/bugzilla/> (raw)

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.


             reply	other threads:[~2012-12-26 20:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-26 20:13 forum at emblocks dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-14983-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).