Re: [BUG] Crash on pgbench initialization.

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: "Anton A. Melnikov" <aamelnikov@inbox.ru>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2023-07-24T08:17:20Z
Lists: pgsql-hackers
On Sun, Jul 23, 2023 at 11:21:47PM +0300, Anton A. Melnikov wrote:
> After some research, found this happens when the LimitAdditionalPins() returns exactly zero.
> In the current master, this will happen e.g. if shared_buffers = 10MB and max_worker_processes = 40.
> Then the command "pgbench --initialize postgres" will lead to crash.
> See the backtrace attached.
> 
> There is a fix in the patch applied. Please take a look on it.

Nice catch, issue reproduced here so I am adding an open item for now.
(I have not looked at the patch, yet.)
--
Michael

Commits

  1. Fix off-by-one in LimitAdditionalPins()