Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ndzuE-0001cO-VH for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Apr 2022 19:40:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ndzuD-0001O9-IX for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Apr 2022 19:40:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ndzuC-0001Nz-E2 for pgsql-bugs@lists.postgresql.org; Mon, 11 Apr 2022 19:40:57 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ndzuA-000508-12 for pgsql-bugs@lists.postgresql.org; Mon, 11 Apr 2022 19:40:55 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3AF4E5C01E4; Mon, 11 Apr 2022 15:40:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 11 Apr 2022 15:40:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1649706053; x=1649792453; bh=1V0x6jsxZw CRTePQpO5N4J0i+lrCiMsF+pDb8ETD7tw=; b=VyTKDNZCYb/KDNUIrtr6aRKvl0 vyN+4sn1VmYZtln9zvdcyA6P3frj8UxgZDy05j9rR3xzXlEIj8l74ZmqhowTd0dR jpfvlOqSLAx5lNGSwLbPNId2xuKWpYCzOZ47DJFMeJPgt1SEVKyhbxq7m9/OqZz3 MbjpfV7F63b5toZNw56XOp+dQpIwI15l3BhVxSBUhlSO2OVeUhPc8XCNm1lvaCbQ 8sY8Z89g1vHOFSNkCoKenZCtQhnY4XQyBmJ4+xNBukDrHd85O5ajg2mihixGDUQx 5hu1doyg53R2L8qN4NQ9iCK807b/RdFi6jmYh4zItRXvyhdA+QB43Ihn4Zfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1649706053; x= 1649792453; bh=1V0x6jsxZwCRTePQpO5N4J0i+lrCiMsF+pDb8ETD7tw=; b=b +IAQdWiV5Z/RHsONDmxDFxghIC2PC6IQBwG3d/+uE2NVCzIxb46ioZj3bDHVypGF zb/9Fk9oiP6cQ0G0WlCEPk5OL0uKvBfrC3U3O2yAG4CooSIXTKnqwR4MBrChRJ+k vC7JZGrwYiTWysW+XLg2CS1eA2a8p5nPQ7u7ncJ9/duz+9pjaNLmUSghQ5+jH9Az g8KGf9kifwZkFZxHIjxAj4xNWPkpkhAy+OO+lKrNM+nx4EgFLQVPpHjoEKpygSbh g5g0/6yTTDuPdlT92MFnVMupIcyP0T7y2NBPuMwE4y6GnDv7XelzdYLGqq7WWZew Hmyf/Zs6DdSWbDSxRA0XQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekiedgudegudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegr nhgrrhgriigvlhdruggvqeenucggtffrrghtthgvrhhnpedukefhkeelueegveetheelff ffjeegleeuudelfeefuedtleffueejfffhueffudenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Apr 2022 15:40:52 -0400 (EDT) Date: Mon, 11 Apr 2022 12:40:51 -0700 From: Andres Freund To: Tom Lane Cc: anisimow.d@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17462: Invalid memory access in heapam_tuple_lock Message-ID: <20220411194051.sovwssdawxoh4m5h@alap3.anarazel.de> References: <17462-9c98a0f00df9bd36@postgresql.org> <286748.1649692519@sss.pgh.pa.us> <288544.1649693991@sss.pgh.pa.us> <20220411173417.ocwjn5xrkqqjiysl@alap3.anarazel.de> <352840.1649699498@sss.pgh.pa.us> <20220411190042.o5ebdhc5qsejleff@alap3.anarazel.de> <496872.1649705112@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <496872.1649705112@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-04-11 15:25:12 -0400, Tom Lane wrote: > Andres Freund writes: > > Another approach is to extend the SatisfiesDirty approach and store the tid of > > the next tuple version in addition the xmin/xmax we already store. And have > > heap_fetch() always set t_data to NULL if the snapshot check fails. > > That seems like a fairly clean idea, although I think we can't use it > in the back branches without an ABI break. We're not going to find a > TID's worth of padding space in struct SnapshotData. Right. There's enough space on x86-64, just not contiuous. But not on 32bit x86, so even if we were willing to live with the ugliness of splitting ItemPointerData across fields temporarily (which I don't think we would)... I guess we could put members of SnapshotData into a union with ItemPointerData that aren't used by InitDirtySnapshot()/HeapTupleSatisfiesDirty(). E.g. ph_node - which fairly fundamentally won't be used by dirty snapshots, and seems unlikely to be used by any extensions? And even if, it'd cause a compile-time breakage for such extensions, not a silent ABI breakage... Greetings, Andres Freund