From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xJapH85V5GODvi0AWB0awg (envelope-from ) for ; Wed, 08 Feb 2023 21:09:18 -0500 Received: by simark.ca (Postfix, from userid 112) id 75C651E15D; Wed, 8 Feb 2023 21:09:18 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=K0I6oy54; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2B0A51E110 for ; Wed, 8 Feb 2023 21:09:18 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 55A4A385840F for ; Thu, 9 Feb 2023 02:09:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55A4A385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675908557; bh=MbkNP55IpixTTiuZq5ISy+js2veFuRd8ig4V/SZUEdY=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=K0I6oy54JR02Pfk3eT3MiCCwPDZvGCfTaIPJHinT0wwbdC4wBmqFKuuD/6rPqohVn K5QGHoN937MDx44z8v+TGLEsSsSkiZCp30+k+i7P2zNayRSF0VslG6E1H4G4YYIXGm P6cb7tPJq0JFNe8qd7KV446spbj5cB38mrg/cji4= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 7953E3858C50 for ; Thu, 9 Feb 2023 02:08:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7953E3858C50 Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 17F461E110; Wed, 8 Feb 2023 21:08:54 -0500 (EST) Message-ID: Date: Wed, 8 Feb 2023 21:08:54 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] Always create a new value object in valpy_do_cast Content-Language: en-US To: Tom Tromey , Hannes Domani Cc: Hannes Domani via Gdb-patches References: <20230118172740.2171-1-ssbssa.ref@yahoo.de> <20230118172740.2171-1-ssbssa@yahoo.de> <87tu0ijw76.fsf@tromey.com> <861084923.719650.1674411768974@mail.yahoo.com> <87lelujntp.fsf@tromey.com> In-Reply-To: <87lelujntp.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 1/22/23 15:50, Tom Tromey wrote: >>>>>> "Hannes" == Hannes Domani 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