public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/11098] New: GDB/MI crashes in -var-update when using pretty-printing
@ 2009-12-16 18:16 oliver dot gerlich at gmx dot de
  2009-12-16 18:20 ` [Bug mi/11098] " oliver dot gerlich at gmx dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: oliver dot gerlich at gmx dot de @ 2009-12-16 18:16 UTC (permalink / raw)
  To: gdb-prs

In gdb -i mi, when creating a variable object, then switching to another frame, and then updating the 
variable, GDB crashes. These are the exact steps leading to the crash:

$ gdb -i mi
2-enable-pretty-printing
3-interpreter-exec console "python import sys; from libstdcxx.v6.printers import 
register_libstdcxx_printers; register_libstdcxx_printers (None)" 
4-file-exec-and-symbols ./testapp1
5-interpreter-exec console "b testapp1.C:26"
8-exec-run
[wait until breakpoint is hit]
12-stack-select-frame 2
14-var-create - @ allResults
16-stack-select-frame 1
17-var-update --all-values "var1"

The testapp1 source code is attached below (build with "g++ -g -O0 -o testapp1 testapp1.C"; I used 
g++ 4.3.3 on Ubuntu 9.04).
allResults is a local variable that exists in frame 2 but not in frame 1.
If pretty-printing is not enabled, the crash does not occur. Similarly, when looking at a global variable  
instead (like someGlobalVar), the crash doesn't occur.

Here is the backtrace from gdb crash:
(gdb) bt
#0  0xb7c3c07a in strcmp () from /lib/tls/i686/cmov/libc.so.6
#1  0x08201972 in install_new_value (var=0x8ac6608, value=0x0, initial=0) at varobj.c:1586
#2  0x08201d28 in varobj_update (varp=0xbf94f0b0, explicit=1) at varobj.c:1713
#3  0x080fb023 in varobj_update_one (var=0x8ac6608, print_values=PRINT_ALL_VALUES, explicit=1) 
at ./mi/mi-cmd-var.c:721
#4  0x080faff7 in mi_cmd_var_update (command=0x8abc828 "var-update", argv=0x8950380, 
argc=2) at ./mi/mi-cmd-var.c:703
#5  0x080ffffd in mi_cmd_execute (parse=0x89f9108) at ./mi/mi-main.c:1388
#6  0x080ff972 in captured_mi_execute_command (uiout=0x89895f0, data=0x89f9108) at ./mi/mi-
main.c:1194
#7  0x081832e2 in catch_exception (uiout=0x89895f0, func=0x80ff8ae 
<captured_mi_execute_command>, func_args=0x89f9108, mask=6) at exceptions.c:462
#8  0x080ffbef in mi_execute_command (cmd=0x8bc8290 "17-var-update --all-values \"var1\"", 
from_tty=1) at ./mi/mi-main.c:1288
#9  0x080fd0bc in mi_execute_command_wrapper (cmd=0x8bc8290 "17-var-update --all-values 
\"var1\"") at ./mi/mi-interp.c:251
#10 0x0818aa81 in gdb_readline2 (client_data=0x0) at event-top.c:817
#11 0x0818a1a6 in stdin_event_handler (error=0, client_data=0x0) at event-top.c:433
#12 0x08188e86 in handle_file_event (data=...) at event-loop.c:812
#13 0x081885cb in process_event () at event-loop.c:394
#14 0x081886a3 in gdb_do_one_event (data=0x0) at event-loop.c:459
#15 0x081834ab in catch_errors (func=0x81885e0 <gdb_do_one_event>, func_args=0x0, 
errstring=0x8365150 "", mask=6) at exceptions.c:510
#16 0x081886e6 in start_event_loop () at event-loop.c:483
#17 0x080fd131 in mi_command_loop (mi_version=2) at ./mi/mi-interp.c:281
#18 0x080fd0e4 in mi2_command_loop () at ./mi/mi-interp.c:263
#19 0x08183a4c in current_interp_command_loop () at interps.c:288
#20 0x0808e950 in captured_command_loop (data=0x0) at ./main.c:226
#21 0x081834ab in catch_errors (func=0x808e945 <captured_command_loop>, func_args=0x0, 
errstring=0x832441f "", mask=6) at exceptions.c:510
#22 0x0808f898 in captured_main (data=0xbf94f4f0) at ./main.c:902
#23 0x081834ab in catch_errors (func=0x808e986 <captured_main>, func_args=0xbf94f4f0, 
errstring=0x832441f "", mask=6) at exceptions.c:510
#24 0x0808f8ce in gdb_main (args=0xbf94f4f0) at ./main.c:911
#25 0x0808e6c7 in main (argc=3, argv=0xbf94f5a4) at gdb.c:33

The problem is reproducable for me.
Any hints at workarounds for GDB 7.0 would be highly appreciated :-)

-- 
           Summary: GDB/MI crashes in -var-update when using pretty-printing
           Product: gdb
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: mi
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: oliver dot gerlich at gmx dot de
                CC: gdb-prs at sourceware dot org


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug mi/11098] GDB/MI crashes in -var-update when using pretty-printing
  2009-12-16 18:16 [Bug mi/11098] New: GDB/MI crashes in -var-update when using pretty-printing oliver dot gerlich at gmx dot de
@ 2009-12-16 18:20 ` oliver dot gerlich at gmx dot de
  2009-12-31 18:51 ` vladimir at codesourcery dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: oliver dot gerlich at gmx dot de @ 2009-12-16 18:20 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From oliver dot gerlich at gmx dot de  2009-12-16 18:20 -------
Created an attachment (id=4475)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4475&action=view)
testapp1.C source code


-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug mi/11098] GDB/MI crashes in -var-update when using pretty-printing
  2009-12-16 18:16 [Bug mi/11098] New: GDB/MI crashes in -var-update when using pretty-printing oliver dot gerlich at gmx dot de
  2009-12-16 18:20 ` [Bug mi/11098] " oliver dot gerlich at gmx dot de
@ 2009-12-31 18:51 ` vladimir at codesourcery dot com
  2010-03-03 17:11 ` tromey at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vladimir at codesourcery dot com @ 2009-12-31 18:51 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From vladimir at codesourcery dot com  2009-12-31 18:51 -------
I could not reproduce this either with CVS HEAD or GDB 7.0 branch.

Could you try with CVS HEAD and see if that's fixed there. In any case, it's
unlikely that any workaround for such a bug would exist.

-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug mi/11098] GDB/MI crashes in -var-update when using pretty-printing
  2009-12-16 18:16 [Bug mi/11098] New: GDB/MI crashes in -var-update when using pretty-printing oliver dot gerlich at gmx dot de
  2009-12-16 18:20 ` [Bug mi/11098] " oliver dot gerlich at gmx dot de
  2009-12-31 18:51 ` vladimir at codesourcery dot com
@ 2010-03-03 17:11 ` tromey at redhat dot com
  2010-03-03 17:20 ` tromey at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at redhat dot com @ 2010-03-03 17:11 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-03-03 17:11 -------
I reproduced it with head today, on F11.
I had to modify the input script a tiny bit to get it to find
my libstdc++ printers.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-03-03 17:11:42
               date|                            |


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug mi/11098] GDB/MI crashes in -var-update when using pretty-printing
  2009-12-16 18:16 [Bug mi/11098] New: GDB/MI crashes in -var-update when using pretty-printing oliver dot gerlich at gmx dot de
                   ` (2 preceding siblings ...)
  2010-03-03 17:11 ` tromey at redhat dot com
@ 2010-03-03 17:20 ` tromey at redhat dot com
  2010-03-03 18:33 ` tromey at redhat dot com
  2010-03-03 19:03 ` tromey at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at redhat dot com @ 2010-03-03 17:20 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-03-03 17:20 -------
Testing a patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware dot|tromey at redhat dot com
                   |org                         |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-03-03 17:11:42         |2010-03-03 17:20:10
               date|                            |


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug mi/11098] GDB/MI crashes in -var-update when using pretty-printing
  2009-12-16 18:16 [Bug mi/11098] New: GDB/MI crashes in -var-update when using pretty-printing oliver dot gerlich at gmx dot de
                   ` (3 preceding siblings ...)
  2010-03-03 17:20 ` tromey at redhat dot com
@ 2010-03-03 18:33 ` tromey at redhat dot com
  2010-03-03 19:03 ` tromey at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at redhat dot com @ 2010-03-03 18:33 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2010-03-03 18:33 -------
Subject: Bug 11098

CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2010-03-03 18:32:44

Modified files:
	gdb            : ChangeLog varobj.c 

Log message:
	PR mi/11098:
	* varobj.c (install_new_value): Handle case where new print_value
	is NULL.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11418&r2=1.11419
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/varobj.c.diff?cvsroot=src&r1=1.155&r2=1.156


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2010-03-03 18:33 -------
Subject: Bug 11098

CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_1-branch
Changes by:	tromey@sourceware.org	2010-03-03 18:33:04

Modified files:
	gdb            : ChangeLog varobj.c 

Log message:
	PR mi/11098:
	* varobj.c (install_new_value): Handle case where new print_value
	is NULL.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_1-branch&r1=1.11378.2.15&r2=1.11378.2.16
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/varobj.c.diff?cvsroot=src&only_with_tag=gdb_7_1-branch&r1=1.154.2.1&r2=1.154.2.2


------- Additional Comments From tromey at redhat dot com  2010-03-03 18:33 -------
Fix checked in.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug mi/11098] GDB/MI crashes in -var-update when using pretty-printing
  2009-12-16 18:16 [Bug mi/11098] New: GDB/MI crashes in -var-update when using pretty-printing oliver dot gerlich at gmx dot de
                   ` (4 preceding siblings ...)
  2010-03-03 18:33 ` tromey at redhat dot com
@ 2010-03-03 19:03 ` tromey at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at redhat dot com @ 2010-03-03 19:03 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-03-03 19:03 -------
*** Bug 11081 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fuscated at gmail dot com


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2010-03-03 19:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-16 18:16 [Bug mi/11098] New: GDB/MI crashes in -var-update when using pretty-printing oliver dot gerlich at gmx dot de
2009-12-16 18:20 ` [Bug mi/11098] " oliver dot gerlich at gmx dot de
2009-12-31 18:51 ` vladimir at codesourcery dot com
2010-03-03 17:11 ` tromey at redhat dot com
2010-03-03 17:20 ` tromey at redhat dot com
2010-03-03 18:33 ` tromey at redhat dot com
2010-03-03 19:03 ` 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).