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 1vrn8o-006Gnf-2q for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 01:11:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vrn8n-0033bk-2d for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 01:11:09 +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 1vrn8n-0033bc-0A for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 01:11:09 +0000 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vrn8j-00000000oG3-1hmc for pgsql-hackers@postgresql.org; Mon, 16 Feb 2026 01:11:08 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id BB2D17A00CC; Sun, 15 Feb 2026 20:11:04 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Sun, 15 Feb 2026 20:11:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1771204264; x=1771290664; bh=JBMUkpsV9o y6Fj8GSNIP6I5Wncux3WU0qnsfQbuP2T8=; b=U4XN+Vpu9tTwo1JYllV9/byM0h JP4azMGMG6/sHunO4eKlVL4aPQq/b0jartRZOTHDwYqXR0jJdL2xkQhpeBLBslxH ldMLvdJU/atwh+D7VjXNc1hEKKfG/ZR3Izs+hklid1CQISczOT1uFsywXkf0CBsG ZtI4fQBmapY5rjT1oorUm527uLDx8SAwF+lLIFuloIfBSVEusW4MtlR1eDKEbKuD 9IFPGrx9oWoQLiuaw7CBRimbUARN5jSyNYAM8KZ5S9/fjU8NdiFHi3UBN2Fnr0yG 2NbObQo9CnnqOPEEtNyZ331xdpc2TFVsCwcD0L8b0x8G6Urq3uJBwWOTrDzQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1771204264; x=1771290664; bh=JBMUkpsV9oy6Fj8GSNIP6I5Wncux3WU0qns fQbuP2T8=; b=qsGnRAIPVIQ56878TKPOq8o9WQJ2T/oFKJd1vD/syYRYDuo1d6V 9N1mWkJh4IunFNnGIz1tT4haeL8W3tjwR+rJP/bMPwrthnM6aUj0ETYJ4DV41Kyk c7EFXKBLW6tG1RQWVHbuDdW8kPrLPAXNddTnRz6G2ZdE6JfeNNaj8xHozcJufRzl ISrr8dHhhkII/VNSMEkYGjVitNpj9v1hr5k7n89pJxYSRY9ntnlcqO6cS0nTpULn ST02xQmIw8crkLV7LOR4levONNulOhwjkOTQn8kZP1TDfK8k8KPP4/YIk3Or2wAn 8MiBPh6kiN3A3J/GmI1g7XMjFd9GorWXx7A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvudehhedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtdorredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepgeelledtfeetudfhtdeuteffffeu ueevhedufffhuedtueeggedvjefhieekvedvnecuffhomhgrihhnpeigihgushdrshhone cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghh rggvlhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepfedpmhhouggvpehsmh htphhouhhtpdhrtghpthhtohepthhhohhmrghsrdhmuhhnrhhosehgmhgrihhlrdgtohhm pdhrtghpthhtoheprghnthhhohhnihhnrdgsohhnnhgvfhhohiesuggrthgrughoghhhqh drtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhq lhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 15 Feb 2026 20:11:02 -0500 (EST) Date: Mon, 16 Feb 2026 10:10:58 +0900 From: Michael Paquier To: Thomas Munro Cc: Anthonin Bonnefoy , PostgreSQL Hackers Subject: Re: Fix uninitialized xl_running_xacts padding Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pKZFJIeNbrwo32HL" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --pKZFJIeNbrwo32HL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 16, 2026 at 01:17:56PM +1300, Thomas Munro wrote: > Nitpick: the so-called universal zero initialiser syntax (var = {0}) > is a nicer way to do this and generally preferred in new code AFAIK. My memory on the matter may be fuzzy, of course, but the initializer does not guarantee that the padding bytes are initialized to zero because the padding bytes are not associated to a member in the structure. A memset(0), however, makes sure that the padding bytes are full of zeros by taking into account the full size of the structure. We could couple a {0} with some dummy fields in xl_running_xacts, of course. But actually, there may be an even smarter move in this case: LogCurrentRunningXacts() uses MinSizeOfXactRunningXacts to store the data of a xl_running_xacts, based on an offset of xl_running_xacts.xids. So we could move subxid_overflow at the end of xl_running_xacts before xids, shaving these padding bytes away while inserting the record's data. > But in this case, it seems we don't actually worry about initialising > WAL padding bytes in general. valgrind.supp has an entry to prevent > warnings about it. Should we? True about the initialization part, mostly I guess, still we tend to worry about eliminating padding because these are wasted bytes in the WAL records. For example, xlhp_freeze_plans has two bytes of padding, that we eliminate while inserting its record by splitting the FLEXIBLE_ARRAY_MEMBER part. -- Michael --pKZFJIeNbrwo32HL Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmmSbqIACgkQnvQgOdby QH2dVxAAqPvOWkRnhIxsvigvPsfKsEPM/zV2co+vomAouIiohWkLWxiGMbO3OQ3A FPT5WLctORDGicB0bB/g+TOzpx8U7r4/snrxZTXweRsRAepjwQsaVu4ohzQwuqOu z1cY/jYc+LNb2XIwSY9kOTN0HKj+n8Sq7uaEb6qVlbg/P9vvlca9zKmhZrnSsQR+ gvaONnAMbMzk+8fuj8+S1gHeSJRS8ZXmvYE0eOHRXmhWY9nxWi1EvlOq/2yGZo/e 6zciFY5/6uj3N+mBV07h05W5UXOCE7uFlSzKew9lTbl83h/VmmNKb4a1PA6X8JsH 75yeCeF8kvTD5uG561SS4dQAa/5rs8Ea9Nb0hzjLLzfX1XPoaW3WVjWlmj7gHJx5 VO/IHYT5PbU7GiTfJvvafqQUlzM/N01tDnL4SqHdb5N8QGrSxqWHYS40d54/kW6+ 6A/cy7McpcIzmgF+uLaYlg1t+xXOwtgpAPd+8So5AY3GZdZ9tAwzkug2JKHnWkMo j/vJb2hQd0E7MOYGZQrrvWlMPJjLuY0EjR6cvjCKsD2/5EagYVdPPdMf8JKSdZ8f u1UPQZkJTSmTYNMR+kEB3nnGMoSpAxmF85kroaq4psfIXkEwtpnLuUydu/n3Dqw9 AbvqQWSMcwVbgd2NSFwK6P2hPIDR+D0+TgtctRDBDpsgukFrxzU= =Zlsm -----END PGP SIGNATURE----- --pKZFJIeNbrwo32HL--