public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "rw at firstpr dot com.au" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug c++/18627] New: MI -var-list-children on not-yet-created vector crashes gdb and/or provides invalid list of children and their values
Date: Mon, 06 Jul 2015 13:50:00 -0000	[thread overview]
Message-ID: <bug-18627-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=18627

            Bug ID: 18627
           Summary: MI -var-list-children on not-yet-created vector
                    crashes gdb and/or provides invalid list of children
                    and their values
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: rw at firstpr dot com.au
  Target Milestone: ---

Created attachment 8414
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8414&action=edit
C++ test program

My recent bug 18623 concerns C++ Containers Library objects such as vectors of
vectors, and makes it impossible for me to debug programs with such variables
with gdb under Codelite.

This second bug prevents me from debugging with gdb under NetBeans 8.0.2 if the
program contains even simpler use of the Containers Library, such as a vector
of ints.

As far as I can tell, NetBeans is making reasonable requests of gdb. NetBeans
will ask gdb to make a variable object for a variable the inferior has not yet
created. gdb responds by doing so, and it clearly knows the nature of the
variable.

NetBeans then uses -var-list-children on this object and bad things happen. If
it uses this command first, gdb crashes.

If it first gives a "-var-update --all-values *" command, and then gives:
"-var-list-children --all-values "var1" 0 100", then gdb responds as if there
are 100 children of this not-yet created variable, with values evidently read
from unitialized RAM.

Then, when NetBeans gives another "-var-update --all-values *", gdb crashes.

This crashed gdb chews close to 100% CPU and gobbles memory continually. In
some cases I couldn't figure out how to kill it, and had to reboot the system.

I have attached:

1 - Source code of the test program.

After posting this message, I will attach:

2 - Complete instructions on reproducing the fault via a command line session
with gdb. (NetBeans is not required.) This includes instructions on
establishing that printers.py is working fine, since once the vector has been
created, gdb is perfectly capable of reporting the vectors (or a deque's)
structure and the values of its int children.

3 - Annotated debugger console log file (in /tmp/) from a NetBeans session
which did not crash gdb.

4 - Annotated log file from a NetBeans session which crashed gdb.

Please see bug 18623 for background on the recent trunk snapshot version of gdb
I am using, from 2015-07-02.

>From the above, I think an experienced gdb developer will be able to quickly
identify the problem. Hopefully it will be reasonably easy to fix.

I don't like my chances of trying to fix it myself, since I am unfamiliar with
this project. Any fix I developed would be at high risk of causing further
trouble.

Thanks for gdb!

- Robin

-- 
You are receiving this mail because:
You are on the CC list for the bug.


             reply	other threads:[~2015-07-06 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 13:50 rw at firstpr dot com.au [this message]
2015-07-06 13:52 ` [Bug c++/18627] " rw at firstpr dot com.au
2015-07-06 13:53 ` rw at firstpr dot com.au
2015-07-06 13:53 ` rw at firstpr dot com.au
2015-07-06 13:54 ` rw at firstpr dot com.au

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-18627-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).