public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug varobj/28131] New: Segfault in gdbpy_enter_varobj::gdbpy_enter_varobj when debugging in VS Code
@ 2021-07-24 20:01 usaonmonday at gmail dot com
  2021-07-24 23:53 ` [Bug varobj/28131] " usaonmonday at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: usaonmonday at gmail dot com @ 2021-07-24 20:01 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 28131
           Summary: Segfault in gdbpy_enter_varobj::gdbpy_enter_varobj
                    when debugging in VS Code
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: varobj
          Assignee: unassigned at sourceware dot org
          Reporter: usaonmonday at gmail dot com
  Target Milestone: ---

Anything I debug in VS Code ends up in gdb exiting on segfault, if I try
stepping through the code.

I compiled a debug version of gdb and got a core dump. Here is the backtrace:
#0  0x00007fca50787d22 in raise () from /usr/lib/libc.so.6
#1  0x00007fca50771862 in abort () from /usr/lib/libc.so.6
#2  0x000000000069a943 in handle_sigsegv (sig=11) at
../../binutils-gdb/gdb/event-top.c:893
#3  <signal handler called>
#4  gdbpy_enter_varobj::gdbpy_enter_varobj (this=0x7fffaef03e00, var=0x63f00b0)
at ../../binutils-gdb/gdb/varobj.c:209
#5  0x00000000008a3687 in py_varobj_iter::~py_varobj_iter (this=0x64cb140,
__in_chrg=<optimized out>) at ../../binutils-gdb/gdb/python/py-varobj.c:51
#6  0x00000000008a36ca in py_varobj_iter::~py_varobj_iter (this=0x64cb140,
__in_chrg=<optimized out>) at ../../binutils-gdb/gdb/python/py-varobj.c:53
#7  0x0000000000a7f7c8 in std::default_delete<varobj_iter>::operator()
(this=0x6839078, __ptr=0x64cb140)
    at /home/user/gcc-env/include/c++/11/bits/unique_ptr.h:85
#8  0x0000000000a7ea84 in std::unique_ptr<varobj_iter,
std::default_delete<varobj_iter> >::~unique_ptr (this=0x6839078,
__in_chrg=<optimized out>)
    at /home/user/gcc-env/include/c++/11/bits/unique_ptr.h:361
#9  0x0000000000a7e7b0 in varobj_dynamic::~varobj_dynamic (this=0x6839060,
__in_chrg=<optimized out>) at ../../binutils-gdb/gdb/varobj.c:108
#10 0x0000000000a7d00b in varobj::~varobj (this=0x63f00b0, __in_chrg=<optimized
out>) at ../../binutils-gdb/gdb/varobj.c:1850
#11 0x0000000000a7c91c in delete_variable_1 (delcountp=0x7fffaef03fec,
var=0x63f00b0, only_children_p=false, remove_from_parent_p=true)
    at ../../binutils-gdb/gdb/varobj.c:1729
#12 0x0000000000a7c7a3 in delete_variable (var=0x63f00b0,
only_children_p=false) at ../../binutils-gdb/gdb/varobj.c:1678
#13 0x0000000000a79a9e in varobj_delete (var=0x63f00b0, only_children=false) at
../../binutils-gdb/gdb/varobj.c:449
#14 0x00000000007e84b5 in mi_cmd_var_delete (command=0x6675d50 "var-delete",
argv=0x6640520, argc=1) at ../../binutils-gdb/gdb/mi/mi-cmd-var.c:182
#15 0x000000000080319a in mi_cmd_execute (parse=0x63eb4d0) at
../../binutils-gdb/gdb/mi/mi-main.c:2083
#16 0x0000000000802664 in captured_mi_execute_command (uiout=0x25c8eb0,
context=0x63eb4d0) at ../../binutils-gdb/gdb/mi/mi-main.c:1794
#17 0x0000000000802c3c in mi_execute_command (cmd=0x65c7200 "1221-var-delete
var76", from_tty=1) at ../../binutils-gdb/gdb/mi/mi-main.c:1953
#18 0x00000000007ebd76 in mi_execute_command_wrapper (cmd=0x65c7200
"1221-var-delete var76") at ../../binutils-gdb/gdb/mi/mi-interp.c:275
#19 0x00000000007ebdff in mi_execute_command_input_handler (cmd=...) at
../../binutils-gdb/gdb/mi/mi-interp.c:304
#20 0x000000000069a88c in gdb_readline_no_editing_callback
(client_data=0x242eb70) at ../../binutils-gdb/gdb/event-top.c:848
#21 0x000000000069a10d in stdin_event_handler (error=0, client_data=0x242eb70)
at ../../binutils-gdb/gdb/event-top.c:515
#22 0x0000000000bde882 in handle_file_event (file_ptr=0x25a2580, ready_mask=1)
at ../../binutils-gdb/gdbsupport/event-loop.cc:575
#23 0x0000000000bdee1d in gdb_wait_for_event (block=1) at
../../binutils-gdb/gdbsupport/event-loop.cc:701
#24 0x0000000000bddddb in gdb_do_one_event () at
../../binutils-gdb/gdbsupport/event-loop.cc:237
#25 0x00000000007c3745 in start_event_loop () at
../../binutils-gdb/gdb/main.c:421
#26 0x00000000007c3864 in captured_command_loop () at
../../binutils-gdb/gdb/main.c:481
#27 0x00000000007c50e3 in captured_main (data=0x7fffaef04520) at
../../binutils-gdb/gdb/main.c:1353
#28 0x00000000007c5149 in gdb_main (args=0x7fffaef04520) at
../../binutils-gdb/gdb/main.c:1368
#29 0x00000000004188bd in main (argc=3, argv=0x7fffaef04638) at
../../binutils-gdb/gdb/gdb.c:32

It seems like here
gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
: gdbpy_enter (var->root->exp->gdbarch, var->root->exp->language_defn)
{
}

exp has already been deleted, which causes the segfault.

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

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

end of thread, other threads:[~2021-08-02 16:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24 20:01 [Bug varobj/28131] New: Segfault in gdbpy_enter_varobj::gdbpy_enter_varobj when debugging in VS Code usaonmonday at gmail dot com
2021-07-24 23:53 ` [Bug varobj/28131] " usaonmonday at gmail dot com
2021-07-25 14:33 ` ssbssa at sourceware dot org
2021-07-29 13:39 ` tromey at sourceware dot org
2021-07-29 19:28 ` simark at simark dot ca
2021-07-30 17:08 ` tromey at sourceware dot org
2021-07-30 17:28 ` tromey at sourceware dot org
2021-08-02  3:06 ` usaonmonday at gmail dot com
2021-08-02 15:46 ` cvs-commit at gcc dot gnu.org
2021-08-02 16:06 ` cvs-commit at gcc dot gnu.org
2021-08-02 16:06 ` tromey at sourceware 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).