public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug varobj/28131] Segfault in gdbpy_enter_varobj::gdbpy_enter_varobj when debugging in VS Code Date: Mon, 02 Aug 2021 16:06:10 +0000 [thread overview] Message-ID: <bug-28131-4717-FbJyzmQywE@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-28131-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=28131 --- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> --- The gdb-11-branch branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3e5ec878a43ac06624a2cc816a329d9b22b95cac commit 3e5ec878a43ac06624a2cc816a329d9b22b95cac Author: Tom Tromey <tromey@adacore.com> Date: Fri Jul 30 11:18:36 2021 -0600 Avoid crash in varobj deletion PR varobj/28131 points out a crash in the varobj deletion code. It took a while to reproduce this, but essentially what happens is that a top-level varobj deletes its root object, then deletes the "dynamic" object. However, deletion of the dynamic object may cause ~py_varobj_iter to run, which in turn uses gdbpy_enter_varobj: gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var) : gdbpy_enter (var->root->exp->gdbarch, var->root->exp->language_defn) { } However, because var->root has already been destroyed, this is invalid. I've added a new test case. This doesn't reliably crash, but the problem can easily be seen under valgrind (and, I presume, with ASAN, though I did not try this). Tested on x86-64 Fedora 32. I also propose putting this on the GDB 11 branch, with a suitable ChangeLog entry of course. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28131 (cherry picked from commit 4d0754c5f572b01cf2fe6c8ab292adba83331cbc) gdb/ChangeLog 2021-08-02 Tom Tromey <tromey@adacore.com> PR varobj/28131 * varobj.c (~varobj): Delete 'dynamic' before 'root'. gdb/testsuite/ChangeLog 2021-08-02 Tom Tromey <tromey@adacore.com> PR varobj/28131 * gdb.python/py-mi-var-info-path-expression.exp: Add regression test. -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2021-08-02 16:06 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-24 20:01 [Bug varobj/28131] New: " 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 [this message] 2021-08-02 16:06 ` tromey at sourceware dot org
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-28131-4717-FbJyzmQywE@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: linkBe 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).