From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sqIKDhpYNmax/gUAWB0awg (envelope-from ) for ; Sat, 04 May 2024 11:45:30 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=tLea5Y95; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 258541E0C1; Sat, 4 May 2024 11:45:30 -0400 (EDT) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0EAC41E092 for ; Sat, 4 May 2024 11:45:28 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 780003858283 for ; Sat, 4 May 2024 15:45:27 +0000 (GMT) Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 4FC163858C53 for ; Sat, 4 May 2024 15:45:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FC163858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4FC163858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714837509; cv=none; b=HrmUVQt/54iG9hhe18BtbeJWKCAZMnctjGfrYMWMfV5GKWMdiALhJWv6FR40XhDtFKU3NrjPhkKxufk7NsrNZNaf6F225PNGS0YqfdSGwHWt+8Fx91K/dj7xcnDjcpO/2sXcn2xpHWCDbfMMPoyp6QMS7MkH6xUw/kotbkNafXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714837509; c=relaxed/simple; bh=lBquZOl+FncWeOIDGjBeO7ruLgJkKcSKPDlYQh8nyCI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mx8Z6ufwgt39QE5rCRfk7vudcYWVu30+40v/73/oxE4yGYyaECKPZJM/AgWmDKgfmpYY4cyNakz55jboa5mV8i2xVxLoZUmSVf2WvB2Pbi9xxEr5Lj+ijP99GE0GuTHIBT7yE9CLjZ89arSTrxQAYJVhe+t0PSEFqtPCMktyBnQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6002a.ext.cloudfilter.net ([10.0.30.222]) by cmsmtp with ESMTPS id 2vEhsEmu2JXoq3HZRsjaJ9; Sat, 04 May 2024 15:45:05 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 3HZQsClIBiKqR3HZQsRvwO; Sat, 04 May 2024 15:45:04 +0000 X-Authority-Analysis: v=2.4 cv=I9quR8gg c=1 sm=1 tr=0 ts=66365800 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=TpHVaj0NuXgA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=zstS-IiYAAAA:8 a=10jsRuRkprjOpHxG27cA:9 a=ul9cdbp4aOFLsgKbc677:22 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Xa4XMFdt1BJ6NS9N3SRE5X6RdCoY3BtBwYFuQLP/gks=; b=tLea5Y95k2IJdwyVhuzoT+2gYq aApL8XlK3mgNsT/qNtX876uHcnqcY/BUaFQ2DU0wsHHoSUGh9mwnbw3nHzy1deO6ri+fxIRZlQ7ZA +aPPTfv5WWKOy+R23hD2Byxhu; Received: from 97-122-86-252.hlrn.qwest.net ([97.122.86.252]:36392 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1s3HZQ-002tqg-0g; Sat, 04 May 2024 09:45:04 -0600 From: Tom Tromey To: Hannes Domani Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix heap-use-after-free in index-cached with --disable-threading In-Reply-To: <20240504110942.922-1-ssbssa@yahoo.de> (Hannes Domani's message of "Sat, 4 May 2024 13:09:42 +0200") References: <20240504110942.922-1-ssbssa.ref@yahoo.de> <20240504110942.922-1-ssbssa@yahoo.de> X-Attribution: Tom Date: Sat, 04 May 2024 09:45:03 -0600 Message-ID: <878r0p1szk.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.86.252 X-Source-L: No X-Exim-ID: 1s3HZQ-002tqg-0g X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-86-252.hlrn.qwest.net (prentzel) [97.122.86.252]:36392 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNk9tD0ewaItUsDMWaHJUDAQmbLWpSfWTAvRlUI57oZVZScHXBU4SltEjlQePf/G2j7NBBc4jbMELHqXh7QGiK/YVorrOV7aXHiNRWxjxohjNPvFdhEz JGGAS8p8mIrJN42dgwo78or1sYkYRC9QpiybJ1e/tM8EmVGaX4FJ+9Bm7d7U3igakQqMzp5Qg6K5BdrLX2y0iLi81pNRa6GCrRc= X-Spam-Status: No, score=-3014.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org >>>>> "Hannes" == Hannes Domani writes: Hannes> Fixed by making cooked_index_worker::wait only return true if desired_state Hannes> is CACHE_DONE, same as if threading was enabled, so m_state will not be Hannes> prematurely deleted. Hannes> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31694 Thank you. This is ok. Approved-By: Tom Tromey Hannes> #else Hannes> /* Without threads, all the work is done immediately on the main Hannes> thread, and there is never anything to wait for. */ Hannes> - done = true; Hannes> + done = desired_state == cooked_state::CACHE_DONE; Hannes> #endif /* CXX_STD_THREAD */ I wouldn't mind if this code were lowered out of the #if, like: #endif /* CXX_STD_THREAD */ bool done = ... However I think it's also fine as-is and can be tidied up later if anyone cares to. Tom