Re: BUG #17619: AllocSizeIsValid violation in parallel hash join - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: BUG #17619: AllocSizeIsValid violation in parallel hash join
Date
Msg-id CAH2-Wz=Uj=AyZ8Zcz_qoji1HeBrni+M24xTP8RtD12109pw4OQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17619: AllocSizeIsValid violation in parallel hash join  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-bugs
On Tue, Sep 27, 2022 at 9:40 AM Peter Geoghegan <pg@bowt.ie> wrote:
> I'm not completely sure, but I think that the explanation might just
> be that the memory is likely to be "zero initialized" in practice.
> Even when it isn't we're still only talking about instrumentation
> counters that start out with garbage values -- so nothing truly
> critical.

Actually, it looks like we'll always have each worker zero-initialize
their space for buffer stats and WAL stats in InstrEndParallelQuery(),
which is also called by nbtsort.c and by parallel VACUUM. So as it
turns out there is no issue with uninitialized memory here.

I don't think that that changes all that much. It still seems like a
good idea to do all required zero initialization in the leader, up
front. We're talking about very small structures here, so there is no
reason to not have a uniform, centralized approach in
ParallelQueryMain(). We actually zero initialized the dead_items array
for PARALLEL_VACUUM_KEY_DEAD_ITEMS, which is probably unnecessary and
has non-trivial overhead, but we don't zero initialize relatively tiny
WAL and buffer instrumentation counters nearby.

-- 
Peter Geoghegan



pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #17619: AllocSizeIsValid violation in parallel hash join
Next
From: Peter Geoghegan
Date:
Subject: Re: BUG #17619: AllocSizeIsValid violation in parallel hash join