public inbox for [email protected]
help / color / mirror / Atom feedFrom: Thomas Munro <[email protected]>
To: Chao Li <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: repack: fix uninitialized DecodingWorkerShared.initialized
Date: Fri, 17 Apr 2026 22:27:19 +1200
Message-ID: <CA+hUKG+YxHMjaSzhgsXd9stiAiaQCjsM9Q2u+_emCBrN_iqvdg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On Thu, Apr 16, 2026 at 2:17 AM Chao Li <[email protected]> wrote:
> I checked the code of dsm_create(), and I did not see anything showing that the created shared-memory segment is zeroed.
>
> This is actually just an eyeball finding. From my tracing on my MacBook, after shared = (DecodingWorkerShared *) dsm_segment_address(seg);, the memory always seemed to be zeroed, so I may have missed something. But given that the code explicitly initializes several other fields, it seems better not to rely on that implicitly.
For the record, that depends on whether you get a newly allocated
shared memory segment from the operating system, or recycled shared
memory reserved at startup with the min_dynamic_shared_memory setting
(as shown in Alexander Lakhin's reproducer).
view thread (4+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: repack: fix uninitialized DecodingWorkerShared.initialized
In-Reply-To: <CA+hUKG+YxHMjaSzhgsXd9stiAiaQCjsM9Q2u+_emCBrN_iqvdg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox