This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]