public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/12531] New: Crash when -var-set-visualizer <something> gdb.default_visualizer
@ 2011-03-02 10:53 dodji at seketeli dot org
  2011-03-02 11:06 ` [Bug mi/12531] " pmuldoon at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dodji at seketeli dot org @ 2011-03-02 10:53 UTC (permalink / raw)
  To: gdb-prs

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

           Summary: Crash when -var-set-visualizer <something>
                    gdb.default_visualizer
           Product: gdb
           Version: archer
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
        AssignedTo: unassigned@sourceware.org
        ReportedBy: dodji@seketeli.org


[dodji@adjoa test]$ cat test.cc
    #include <string>

    using std::string;

    class person
    {
    string m_name;

    public:
    person (const string& name = ""):
        m_name (name)
    {
    }
    };

    int
    main()
    {
    person p ("Toto");
    return 0;
    }

Then I comiled this with g++ -g test test.cc

Then after this gdb/mi session, I get a segmentation fault:

    [dodji@adjoa test]$ gdb --interpreter=mi2 ./test
    ~"GNU gdb (GDB) Fedora (7.1-34.fc13)\n"
    ~"Copyright (C) 2010 Free Software Foundation, Inc.\n"
    ~"License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>\n"
    ~"This is free software: you are free to change and redistribute it.\n"
    ~"There is NO WARRANTY, to the extent permitted by law.  Type \"show
copying\"\n"
    ~"and \"show warranty\" for details.\n"
    ~"This GDB was configured as \"x86_64-redhat-linux-gnu\".\n"
    ~"For bug reporting instructions, please see:\n"
    ~"<http://www.gnu.org/software/gdb/bugs/>...\n"
    ~"\nwarning: "
    ~"Current output protocol does not support redirection\n"
    ~"Reading symbols from /home/dodji/test/test..."
    ~"done.\n"
    (gdb) 
    b main
    ~"b main\n"
    ~"Breakpoint 1 at 0x4007af: file test.cc, line 19.\n"
    ^done
    (gdb) 
    run
    ~"run\n"
    ~"Starting program: /home/dodji/test/test \n"
    =thread-group-created,id="18627"
    =thread-created,id="1",group-id="18627"
    ^running
    *running,thread-id="all"
    (gdb) 
   
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0"
   
=library-loaded,id="/usr/lib64/libstdc++.so.6",target-name="/usr/lib64/libstdc++.so.6",host-name="/usr/lib64/libstdc++.so.6",symbols-loaded="0"
   
=library-loaded,id="/lib64/libm.so.6",target-name="/lib64/libm.so.6",host-name="/lib64/libm.so.6",symbols-loaded="0"
   
=library-loaded,id="/lib64/libgcc_s.so.1",target-name="/lib64/libgcc_s.so.1",host-name="/lib64/libgcc_s.so.1",symbols-loaded="0"
   
=library-loaded,id="/lib64/libc.so.6",target-name="/lib64/libc.so.6",host-name="/lib64/libc.so.6",symbols-loaded="0"
    ~"\n"
    ~"Breakpoint 1, main () at test.cc:19\n"
    ~"19\t    person p (\"Toto\");\n"
   
*stopped,frame={addr="0x00000000004007af",func="main",args=[],file="test.cc",fullname="/home/dodji/test/test.cc",line="19"},thread-id="1",stopped-threads="all",core="2"
    (gdb) 
    -enable-pretty-printing
    ^done
    (gdb) 
    n
    ~"n\n"
    ^running
    *running,thread-id="1"
    (gdb) 
    ~"20\t    return 0;\n"
   
*stopped,frame={addr="0x0000000000400850",func="main",args=[],file="test.cc",fullname="/home/dodji/test/test.cc",line="20"},thread-id="1",stopped-threads="all",core="2"
    (gdb) 
    -var-create - * p
   
^done,name="var1",numchild="1",value="{...}",type="person",thread-id="1",has_more="0"
    (gdb) 
    -var-list-children --all-values var1
   
^done,numchild="1",children=[child={name="var1.private",exp="private",numchild="1",value="",thread-id="1"}],has_more="0"
    (gdb) 
    -var-list-children --all-values var1.private
   
^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="0",value="\"Toto\"",type="std::string",thread-id="1",displayhint="string",dynamic="1"}],has_more="0"
    (gdb) 
    -var-list-children --all-values var1.private.m_name
    ^done,numchild="0",displayhint="string",has_more="0"
    (gdb) 
    -var-set-visualizer var1 None
    ^done
    (gdb) 
    -var-set-visualizer var1.private None
    ^error,msg="Variable object not found"
    (gdb) 
    -var-list-children --all-values var1
   
^done,numchild="1",children=[child={name="var1.private",exp="private",numchild="1",value="",thread-id="1"}],has_more="0"
    (gdb) 
    -var-set-visualizer var1.private None
    ^done
    (gdb) 
    -var-list-children --all-values var1.private
   
^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="0",value="\"Toto\"",type="std::string",thread-id="1",displayhint="string",dynamic="1"}],has_more="0"
    (gdb) 
    -var-set-visualizer var1.private.m_name None
    ^done
    (gdb) 
    -var-list-children --all-values var1.private.m_name
   
^done,numchild="2",children=[child={name="var1.private.m_name.public",exp="public",numchild="1",value="",thread-id="1"},child={name="var1.private.m_name.private",exp="private",numchild="1",value="",thread-id="1"}],has_more="0"
    (gdb) 
    -var-list-children --all-values var1.private.m_name.public
   
^done,numchild="1",children=[child={name="var1.private.m_name.public.npos",exp="npos",numchild="0",value="",type="const
size_t",thread-id="1"}],has_more="0"
    (gdb) 
    -var-set-visualizer var1.private gdb.default_visualizer

    ^
    |
     --- segmentation fault when I hit enter after this command.


[dodji@adjoa test]$ gdb --version
GNU gdb (GDB) Fedora (7.1-34.fc13)
[...]
This GDB was configured as "x86_64-redhat-linux-gnu"

-- 
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] 7+ messages in thread

* [Bug mi/12531] Crash when -var-set-visualizer <something> gdb.default_visualizer
  2011-03-02 10:53 [Bug mi/12531] New: Crash when -var-set-visualizer <something> gdb.default_visualizer dodji at seketeli dot org
@ 2011-03-02 11:06 ` pmuldoon at redhat dot com
  2011-04-29 12:46 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pmuldoon at redhat dot com @ 2011-03-02 11:06 UTC (permalink / raw)
  To: gdb-prs

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

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pmuldoon at redhat dot com

--- Comment #1 from Phil Muldoon <pmuldoon at redhat dot com> 2011-03-02 11:05:59 UTC ---
Replicated upstream. GDB backtrace:


-var-set-visualizer var1.private gdb.default_visualizer

Program received signal SIGSEGV, Segmentation fault.
0x0000000000540384 in value_incref (val=
During symbol reading, incomplete CFI data; unspecified registers (e.g., rax)
at 0x540398.
0x0) at ../../archer/gdb/value.c:1142
1142      val->reference_count++;
(top-gdb) bt
#0  0x0000000000540384 in value_incref (val=0x0) at
../../archer/gdb/value.c:1142
#1  0x0000000000512063 in value_to_value_object (val=0x0) at
../../archer/gdb/python/py-value.c:1055
#2  0x0000000000639ec3 in instantiate_pretty_printer
(constructor=0x7ffff2015a28, value=0x0) at ../../archer/gdb/varobj.c:780
#3  0x000000000063b09d in construct_visualizer (var=0xeb8d00,
constructor=0x7ffff2015a28) at ../../archer/gdb/varobj.c:1389
#4  0x000000000063b7ee in varobj_set_visualizer (var=0xeb8d00,
visualizer=0xbb7020 "gdb.default_visualizer") at ../../archer/gdb/varobj.c:1661
#5  0x00000000004e9d18 in mi_cmd_var_set_visualizer (command=0xeddb20
"var-set-visualizer", argv=0xc78050, argc=2) at
../../archer/gdb/mi/mi-cmd-var.c:281
#6  0x00000000004f1d59 in mi_cmd_execute (parse=0xe96740) at
../../archer/gdb/mi/mi-main.c:2094
#7  0x00000000004f13d1 in captured_mi_execute_command (uiout=0xc38b20,
data=0xe96740) at ../../archer/gdb/mi/mi-main.c:1845
#8  0x000000000059a568 in catch_exception (uiout=0xc38b20, func=0x4f12ff
<captured_mi_execute_command>, func_args=0xe96740, mask=6) at
../../archer/gdb/exceptions.c:471
#9  0x00000000004f1792 in mi_execute_command (cmd=0xf8cf90 "-var-set-visualizer
var1.private gdb.default_visualizer", from_tty=1) at
../../archer/gdb/mi/mi-main.c:1965
#10 0x00000000004ecd70 in mi_execute_command_wrapper (cmd=0xf8cf90
"-var-set-visualizer var1.private gdb.default_visualizer") at
../../archer/gdb/mi/mi-interp.c:266
#11 0x00000000005a2f36 in gdb_readline2 (client_data=0x0) at
../../archer/gdb/event-top.c:785
#12 0x00000000005a2699 in stdin_event_handler (error=0, client_data=0x0) at
../../archer/gdb/event-top.c:434
#13 0x00000000005a0d82 in handle_file_event (data=...) at
../../archer/gdb/event-loop.c:831
#14 0x00000000005a0278 in process_event () at ../../archer/gdb/event-loop.c:402
#15 0x00000000005a0343 in gdb_do_one_event (data=0x0) at
../../archer/gdb/event-loop.c:467
#16 0x000000000059a72f in catch_errors (func=0x5a0286 <gdb_do_one_event>,
func_args=0x0, errstring=0x7fd368 "", mask=6) at
../../archer/gdb/exceptions.c:521
#17 0x00000000005a037c in start_event_loop () at
../../archer/gdb/event-loop.c:491
#18 0x00000000004ecddf in mi_command_loop (mi_version=2) at
../../archer/gdb/mi/mi-interp.c:296
#19 0x00000000004ecd90 in mi2_command_loop () at
../../archer/gdb/mi/mi-interp.c:278
#20 0x000000000059ae88 in current_interp_command_loop () at
../../archer/gdb/interps.c:288
#21 0x0000000000451e03 in captured_command_loop (data=0x0) at
../../archer/gdb/main.c:228
#22 0x000000000059a72f in catch_errors (func=0x451df2 <captured_command_loop>,
func_args=0x0, errstring=0x7ac8e7 "", mask=6) at
../../archer/gdb/exceptions.c:521
#23 0x0000000000452e91 in captured_main (data=0x7fffffffe0a0) at
../../archer/gdb/main.c:933
#24 0x000000000059a72f in catch_errors (func=0x451e37 <captured_main>,
func_args=0x7fffffffe0a0, errstring=0x7ac8e7 "", mask=6) at
../../archer/gdb/exceptions.c:521
#25 0x0000000000452ec7 in gdb_main (args=0x7fffffffe0a0) at
../../archer/gdb/main.c:942
#26 0x0000000000451b12 in main (argc=3, argv=0x7fffffffe1a8) at
../../archer/gdb/gdb.c:35

-- 
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] 7+ messages in thread

* [Bug mi/12531] Crash when -var-set-visualizer <something> gdb.default_visualizer
  2011-03-02 10:53 [Bug mi/12531] New: Crash when -var-set-visualizer <something> gdb.default_visualizer dodji at seketeli dot org
  2011-03-02 11:06 ` [Bug mi/12531] " pmuldoon at redhat dot com
@ 2011-04-29 12:46 ` cvs-commit at gcc dot gnu.org
  2011-04-29 12:51 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-04-29 12:46 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-04-29 12:45:49 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    pmuldoon@sourceware.org    2011-04-29 12:45:46

Modified files:
    gdb            : ChangeLog varobj.c 
    gdb/testsuite  : ChangeLog 
    gdb/testsuite/gdb.python: py-mi.exp py-prettyprint.c 

Log message:
    2011-04-29  Phil Muldoon  <pmuldoon@redhat.com>

    PR mi/12531

    * varobj.c (install_default_visualizer): Do not install a
    visualizer if the varobj is CPLUS_FAKE_CHILD.
    (construct_visualizer): Likewise.

    2011-04-29  Phil Muldoon  <pmuldoon@redhat.com>

    PR mi/12531

    * gdb.python/py-mi.exp: Add CPLUS_FAKE_CHILD tests and a C++
    compile target.
    * gdb.python/py-prettyprint.exp: Add C++ object for
    CPLUS_FAKE_CHILD test.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12965&r2=1.12966
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/varobj.c.diff?cvsroot=src&r1=1.176&r2=1.177
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2685&r2=1.2686
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-mi.exp.diff?cvsroot=src&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-prettyprint.c.diff?cvsroot=src&r1=1.11&r2=1.12

-- 
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] 7+ messages in thread

* [Bug mi/12531] Crash when -var-set-visualizer <something> gdb.default_visualizer
  2011-03-02 10:53 [Bug mi/12531] New: Crash when -var-set-visualizer <something> gdb.default_visualizer dodji at seketeli dot org
  2011-03-02 11:06 ` [Bug mi/12531] " pmuldoon at redhat dot com
  2011-04-29 12:46 ` cvs-commit at gcc dot gnu.org
@ 2011-04-29 12:51 ` cvs-commit at gcc dot gnu.org
  2011-04-29 12:53 ` pmuldoon at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-04-29 12:51 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-04-29 12:50:41 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Branch:     gdb_7_3-branch
Changes by:    pmuldoon@sourceware.org    2011-04-29 12:50:39

Modified files:
    gdb            : ChangeLog varobj.c 
    gdb/testsuite  : ChangeLog 
    gdb/testsuite/gdb.python: py-mi.exp py-prettyprint.c 

Log message:
    2011-04-29  Phil Muldoon  <pmuldoon@redhat.com>

    PR mi/12531

    * varobj.c (install_default_visualizer): Do not install a
    visualizer if the varobj is CPLUS_FAKE_CHILD.
    (construct_visualizer): Likewise.

    2011-04-29  Phil Muldoon  <pmuldoon@redhat.com>

    PR mi/12531

    * gdb.python/py-mi.exp: Add CPLUS_FAKE_CHILD tests and a C++
    compile target.
    * gdb.python/py-prettyprint.exp: Add C++ object for
    CPLUS_FAKE_CHILD test.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.12887.2.15&r2=1.12887.2.16
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/varobj.c.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.176&r2=1.176.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.2655.2.5&r2=1.2655.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-mi.exp.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.9&r2=1.9.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-prettyprint.c.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.10&r2=1.10.2.1

-- 
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] 7+ messages in thread

* [Bug mi/12531] Crash when -var-set-visualizer <something> gdb.default_visualizer
  2011-03-02 10:53 [Bug mi/12531] New: Crash when -var-set-visualizer <something> gdb.default_visualizer dodji at seketeli dot org
                   ` (2 preceding siblings ...)
  2011-04-29 12:51 ` cvs-commit at gcc dot gnu.org
@ 2011-04-29 12:53 ` pmuldoon at redhat dot com
  2011-04-29 12:54 ` pmuldoon at redhat dot com
  2011-05-01 11:00 ` dodji at seketeli dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pmuldoon at redhat dot com @ 2011-04-29 12:53 UTC (permalink / raw)
  To: gdb-prs

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

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware    |pmuldoon at redhat dot com
                   |dot org                     |

-- 
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] 7+ messages in thread

* [Bug mi/12531] Crash when -var-set-visualizer <something> gdb.default_visualizer
  2011-03-02 10:53 [Bug mi/12531] New: Crash when -var-set-visualizer <something> gdb.default_visualizer dodji at seketeli dot org
                   ` (3 preceding siblings ...)
  2011-04-29 12:53 ` pmuldoon at redhat dot com
@ 2011-04-29 12:54 ` pmuldoon at redhat dot com
  2011-05-01 11:00 ` dodji at seketeli dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pmuldoon at redhat dot com @ 2011-04-29 12:54 UTC (permalink / raw)
  To: gdb-prs

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

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |7.3

--- Comment #4 from Phil Muldoon <pmuldoon at redhat dot com> 2011-04-29 12:54:17 UTC ---
Committed to 7.3 release branch and head.  Fixed as detailed in comment #3.

-- 
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] 7+ messages in thread

* [Bug mi/12531] Crash when -var-set-visualizer <something> gdb.default_visualizer
  2011-03-02 10:53 [Bug mi/12531] New: Crash when -var-set-visualizer <something> gdb.default_visualizer dodji at seketeli dot org
                   ` (4 preceding siblings ...)
  2011-04-29 12:54 ` pmuldoon at redhat dot com
@ 2011-05-01 11:00 ` dodji at seketeli dot org
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at seketeli dot org @ 2011-05-01 11:00 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from dodji at seketeli dot org 2011-05-01 10:59:49 UTC ---
> Committed to 7.3 release branch and head.  Fixed as detailed in comment #3.

Thanks.

-- 
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] 7+ messages in thread

end of thread, other threads:[~2011-05-01 11:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 10:53 [Bug mi/12531] New: Crash when -var-set-visualizer <something> gdb.default_visualizer dodji at seketeli dot org
2011-03-02 11:06 ` [Bug mi/12531] " pmuldoon at redhat dot com
2011-04-29 12:46 ` cvs-commit at gcc dot gnu.org
2011-04-29 12:51 ` cvs-commit at gcc dot gnu.org
2011-04-29 12:53 ` pmuldoon at redhat dot com
2011-04-29 12:54 ` pmuldoon at redhat dot com
2011-05-01 11:00 ` dodji at seketeli dot org

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