Re: AioCtl Shared Memory size fix - Mailing list pgsql-hackers

From Matthias van de Meent
Subject Re: AioCtl Shared Memory size fix
Date
Msg-id CAEze2WjYnqDQ+94z2zB7j_q7Ta+ySy65Jyo8fYfQTVQ0Oba3eA@mail.gmail.com
Whole thread Raw
In response to AioCtl Shared Memory size fix  ("Madhukar ." <madhukarprasad@google.com>)
List pgsql-hackers
On Mon, 15 Sept 2025 at 13:33, Madhukar . <madhukarprasad@google.com> wrote:
>
> Hi Folks,
>
> While reviewing AIO code, we found an issue with AioCtlShmemSize function. The function was not accounting for
io_handleswhich is used post shared memory alloc in AioShmemInit.
 

Good catch.

Presumably this was `PgAioHandle io_handles[]` at some point, but now
that it's a pointer it's a proper part of the struct's own size, and
should be treated as such for memory accounting.

> Please find a patch to account for io_handles member of PgAioCtl.
> The patch uses sizeof(PgAioCtl) instead of offsetof(PgAioCtl, io_handles) in AioCtlShmemSize.

LGTM.


Kind regards,

Matthias van de Meent
Databricks



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Fix missing EvalPlanQual recheck for TID scans
Next
From: Amit Kapila
Date:
Subject: Re: Conflict detection for update_deleted in logical replication