public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH v3] [gdb/testsuite] test a function call by hand from pretty printer
Date: Wed, 23 Mar 2022 12:37:18 -0300	[thread overview]
Message-ID: <853f9e05-c815-d04c-371c-0fb1f31df2f2@redhat.com> (raw)
In-Reply-To: <1a80930b-0bf3-9147-2065-e1bf474990d0@simark.ca>

On 3/21/22 17:21, Simon Marchi wrote:
> 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
> 

Hi

Oh sorry, I didn't think about that. My thinking was that this looked like a pretty complex issue, so I could at least get some sort conversation going in case anyone knew how to fix the problem, and could help me find the origin of the problems. It doesn't test anything new that doesn't fail, but unfortunately, I had already pushed the change when your email arrived. If you want to remove it until I have a fix, I understand it. Sorry again.

-- 
Cheers!
Bruno Larsen


  reply	other threads:[~2022-03-23 15:37 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
2022-03-23 15:37     ` Bruno Larsen [this message]
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=853f9e05-c815-d04c-371c-0fb1f31df2f2@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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).