Re: Fix uninitialized xl_running_xacts padding

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix uninitialized xl_running_xacts padding
Date: 2026-02-13 10:08:32
Message-ID: aY74IKOgGLF5nj5A@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Fri, Feb 13, 2026 at 06:50:08PM +0900, Michael Paquier wrote:
> On Fri, Feb 13, 2026 at 10:39:14AM +0100, Anthonin Bonnefoy wrote:
> > The 3 bytes of padding after subxid_overflow were left uninitialized,
> > leading to the random 'ca ce 9b' data being written in the WAL. The
> > attached patch fixes the issue by zeroing the xl_running_xacts
> > structure in LogCurrentRunningXacts using MemSet.
>
> This uninitialized padding exists for as long as this code exists,
> down to efc16ea52067. No objection here to clean up that on HEAD.

It's not as important as when a struct which is used as an hash key has padding
bytes uninitialized (and byte comparisons are done on the key) but I'm also
+1 to make it "cleaner".

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-02-13 10:24:52 Re: Adding locks statistics
Previous Message Zsolt Parragi 2026-02-13 09:58:42 Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier