Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wA2dc-0020fM-2Z for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 09:22:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wA2db-00GBXx-0I for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 09:22:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wA2da-00GBXp-2K for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 09:22:23 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wA2dZ-000000010Ru-0jKp for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 09:22:22 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9808C1400190; Tue, 7 Apr 2026 05:22:20 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 07 Apr 2026 05:22:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1775553740; x=1775640140; bh=m 3eG4y7ZVMzxutV1b4wrWBQxaFQ8zT5XHo1k6nPLu9E=; b=ihlpLFMqF6XVKk2Aq oR2ftj9EZKp6BOxLyJPwMlWcxoT5pppOvfuXRh7bHWpkudBdRqyT+blbjPWFXA1U 53WFJowCRzX0CmAB7O82Vh3iKfL3hm6EBUMmsttuWoli2P+rkcG7c/olN7KPsD3T 6MFCnG6JMaxDucClzb+di5Zyi/tOuTbh0fptDbeDOQtB4lA7vr8O6CzWFFOxrXCW S7fbwxX1pgJKvi2wBMHobzVs6LC0QVZhFi+EMpB1b4vwzY2QpZRTugDoVteq06KH sM1ZjPPrlFLUOzf2QpsB8BtIaE4tsSFXuILqurySYQKo26AL7UDi7GyBFrLZDGZP fNU5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvtddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenuc ggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeffgfdu fffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtghpthhtohepuddupdhmohguvg epshhmthhpohhuthdprhgtphhtthhopegrnhgurhgvshesrghnrghrrgiivghlrdguvgdp rhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphhtthhopegrmhhithdrkh grphhilhgrudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghovghkvgifuhhrmhdo phhoshhtghhrvghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhhihhgrihhlnhhikh grlhgrhigvuhesghhmrghilhdrtghomhdprhgtphhtthhopehsrhhinhgrthhhvddufeef sehgmhgrihhlrdgtohhmpdhrtghpthhtohepvhhighhnvghshhdvudesghhmrghilhdrtg homhdprhgtphhtthhopehnohgrhheslhgvrggusghorghtrdgtohhmpdhrtghpthhtohep phhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Apr 2026 05:22:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1775553738; bh=bI/y7p1Hqw1n2HodSRuoMesPvzSZY8twd2rPHeDLhWw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=arwVV5CRKzDLFxGXy73yjVor25cgKzAnqAGpicL+x/en0haRgR5eYHV6c24O39YLH hga7yCPw4GIksm+whYEr9HZ1XjJ2ONtjMqxqgQ0N3esOk5kyck76nL8/AaJlw8rGE8 y5an4K99ggetsVmwphxM1HZd5V+JnfZjR9sgO/C939Nbk5iK7sWGgn8Smx0hCHoVLD 6zOV25ZNYGCSL0/zEY7aouan/aMRXt0eMYRf5WejPFXrOk5wbKPX4K9GjyD9woU3Ka FYNgGZheHh0beyqUaQeBMxwRNHtg6Wqb75NbWCbEJ2EhWhE8W+NB3jNxp/CpCd6B7p tq23aJFAqTUFQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 246557C; Tue, 07 Apr 2026 11:22:18 +0200 (CEST) Date: Tue, 7 Apr 2026 11:22:18 +0200 From: Alvaro Herrera To: Antonin Houska Cc: Srinath Reddy Sadipiralla , Tom Lane , Andres Freund , Noah Misch , vignesh C , Amit Kapila , Mihail Nikalayeu , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] Message-ID: <202604070916.5rj6kvjx3mrk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <188275.1775552266@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Apr-07, Antonin Houska wrote: > > @@ -1739,6 +1739,8 @@ SerializeSnapshot(Snapshot snapshot, char *start_address) > > > > Assert(snapshot->subxcnt >= 0); > > > > + MemSet(&serialized_snapshot, 0, sizeof(SerializedSnapshotData)); > > + > > /* Copy all required fields */ > > serialized_snapshot.xmin = snapshot->xmin; > > serialized_snapshot.xmax = snapshot->xmax; > > > > thoughts? > > Could you reproduce the failure in your environment? Yeah, he did. > I haven't thought of this explanation because BufFileWrite() only copies the > data to a buffer in the BufFile structure and BufFileDumpBuffer() writes the > buffer. Maybe valgrind is able to track the copying? Yeah, apparently it keeps track of tainted bytes somehow. Clever. The change to palloc0() that I was proposing did not fix the problem, because the stack allocated struct overwrote those zeroes with the uninitialized padding bytes. I ended up with an equivalent fix to Srinath's -- zero-initializing the stack-allocated struct, so that the bytes that end up copied by memcpy() are all defined. Srinath confirmed that in his environment the valgrind failure goes away, so I think we're good. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "No tengo por qué estar de acuerdo con lo que pienso" (Carlos Caszeli)