public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, Hannes Domani <ssbssa@yahoo.de>
Cc: Hannes Domani via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Always create a new value object in valpy_do_cast
Date: Wed, 8 Feb 2023 21:08:54 -0500	[thread overview]
Message-ID: <dbff34c0-2165-2355-9854-c67ed86df13e@simark.ca> (raw)
In-Reply-To: <87lelujntp.fsf@tromey.com>



On 1/22/23 15:50, Tom Tromey wrote:
>>>>>> "Hannes" == Hannes Domani <ssbssa@yahoo.de> writes:
> 
> Hannes> The problem isn't the value that's reference by gdb.Value, instead
> Hannes> one of the other values in all_values before it.
> 
> Hannes> But release_value removes it from all_values, and it was the exact value
> Hannes> that the scoped_value_mark free_values instance was using as the mark point,
> Hannes> and since it was then missing, all_values was cleared completely.
> Hannes> And one of those earlier values is still used by the printing later on.
> 
> OMG.  I think this is a latent bug in the value-mark API that's been
> there since... well I don't know exactly when, maybe forever.  So, nice
> find!
> 
> I think what we probably need is to change how the value_mark API works,
> so that it isn't relying on a value pointer being in all_values, but
> rather return some other type/object that isn't invalidated in the same
> way.

Is there an advantage of that value chain thing vs using value_ref_ptr
throughout?  Not replace all `value *` with value_ref_ptr, but have
functions return and accept value_ref_ptr where that makes sense.

Simon

  reply	other threads:[~2023-02-09  2:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230118172740.2171-1-ssbssa.ref@yahoo.de>
2023-01-18 17:27 ` Hannes Domani
2023-01-22 17:49   ` Tom Tromey
2023-01-22 18:22     ` Hannes Domani
2023-01-22 20:50       ` Tom Tromey
2023-02-09  2:08         ` Simon Marchi [this message]
2023-02-09  3:35           ` Tom Tromey
2023-02-08 23:52   ` Tom Tromey
2023-02-09  6:06     ` Hannes Domani

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=dbff34c0-2165-2355-9854-c67ed86df13e@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=ssbssa@yahoo.de \
    --cc=tom@tromey.com \
    /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).