Re: BUG #19551: TRAP: failed Assert("max_pinned_buffers > 0")

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Cc: r(dot)zharkov(at)postgrespro(dot)ru, pgsql-bugs(at)lists(dot)postgresql(dot)org, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: BUG #19551: TRAP: failed Assert("max_pinned_buffers > 0")
Date: 2026-07-13 13:01:26
Message-ID: 3211434.1783947686@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> writes:
> On Sat, 11 Jul 2026 at 15:08, PG Bug reporting form
> <noreply(at)postgresql(dot)org> wrote:
>> This error occurred when attempting run the temp.sql regression test from
>> the master branch on the REL_17_STABLE (#bab0a2db).
>> It seems, REL_16_STABLE and REL_18_STABLE work fine.

> Thank you for the reproducer script.

> I think this is expected. If you disable asserts, you will see an
> actual error message: 'ERROR: no empty local buffer available'. This
> error message can be seen on both REL_16_STABLE and REL_18_STABLE too.

The point is you're not supposed to be able to trigger an Assert from
SQL. I don't see that Assert in 18 and up, and digging in the git
history shows that 92fc6856c replaced it with some logic including

/*
* The limit might be zero on a system configured with too few buffers for
* the number of connections. We need at least one to make progress.
*/
max_pinned_buffers = Max(1, max_pinned_buffers);

The commit message claims

In practice it was quite difficult to exceed limits and cause any real
problems in v17, so no back-patch for now, but proposed changes will
make it easier.

but evidently "quite difficult" isn't so difficult after all.
I think we must back-patch at least this bit of 92fc6856c.

Thomas, what's your thoughts on how much of that commit to back-patch?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Nazir Bilal Yavuz 2026-07-13 13:13:15 Re: BUG #19551: TRAP: failed Assert("max_pinned_buffers > 0")
Previous Message Nazir Bilal Yavuz 2026-07-13 10:33:52 Re: BUG #19551: TRAP: failed Assert("max_pinned_buffers > 0")