public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Bruno Larsen <blarsen@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v3] [gdb/testsuite] test a function call by hand from pretty printer
Date: Mon, 21 Mar 2022 16:21:24 -0400	[thread overview]
Message-ID: <1a80930b-0bf3-9147-2065-e1bf474990d0@simark.ca> (raw)
In-Reply-To: <20220314203926.58662-1-blarsen@redhat.com>

On 2022-03-14 16:39, Bruno Larsen via Gdb-patches wrote:
> The test case added here is testing the bug gdb/28856, where calling a
> function by hand from a pretty printer makes GDB crash. There are 6
> mechanisms to trigger this crash in the current test, using the commands
> backtrace, up, down, finish, step and continue. Since the failure happens
> because of use-after-free (more details below) the tests will always
> have a chance of passing through sheer luck, but anecdotally they seem
> to fail all of the time.
>
> The reason GDB is crashing is a use-after-free problem. The above
> mentioned functions save a pointer to the current frame's information,
> then calls the pretty printer, and uses the saved pointer for different
> reasons, depending on the function. The issue happens because
> call_function_by_hand needs to reset the obstack to get the current
> frame, invalidating the saved pointer.
> ---
>
> Changes from v2:
>     * Make .c follow GDB's coding style 2 - electric boogaloo
>     * .exp tests outputs, not just if GDB breaks or not
>     * added copyright header to .py file
>
> Changes from v1:
>     * make .c follow GDB's coding guidelines more closely
>     * Documented .exp file better
>     * renamed and refactored TCL proc to make it less confusing

Hi,

Having the test without the fix is annoying, because it crashes GDB on
an ASan-enabled build, and causes failures that did not exist before,
and the setup_kfails don't help for that.  This is something we
generally don't want, as we try to strictly progress towards less
failures.

Does the test actually test anything right now, given that everything is
broken?  If not, I'd suggest attaching the test case to the bug, and it
can be merged along with the fix.


Simon

  parent reply	other threads:[~2022-03-21 20:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 18:57 [PATCH] [gdb/testsuite] test a function call by hand fron " Bruno Larsen
2022-02-27 12:39 ` Joel Brobecker
2022-02-28 12:13   ` Bruno Larsen
2022-03-06 10:43     ` Joel Brobecker
2022-03-07 13:09 ` [PATCH v2] " Bruno Larsen
2022-03-13  6:13   ` Joel Brobecker
2022-03-14 20:39 ` [PATCH v3] [gdb/testsuite] test a function call by hand from " Bruno Larsen
2022-03-19 14:41   ` Joel Brobecker
2022-03-21 20:21   ` Simon Marchi [this message]
2022-03-23 15:37     ` Bruno Larsen
2022-03-24 14:18       ` Simon Marchi

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=1a80930b-0bf3-9147-2065-e1bf474990d0@simark.ca \
    --to=simark@simark.ca \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@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: link
Be 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).