Re: BUG #19500: pgrepack logical decoding plugin can crash assert builds via SQL decoding API

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: Никита Калинин <n.kalinin@postgrespro.ru>
Cc: pgsql-bugs@lists.postgresql.org, Antonin Houska <ah@cybertec.at>
Date: 2026-06-02T12:25:51Z
Lists: pgsql-bugs
Hi Nikita,

On 2026-Jun-02, Никита Калинин wrote:

> > On 2 Jun 2026, at 00:12, Álvaro Herrera <alvherre@kurilemu.de> wrote:

> But does the error message need to be that detailed? Perhaps something like
> 
> "ERROR: wrong magic number in "pgrepack" decoder plugin"
> would be sufficient.

Maybe.  Getting 0x00000000 would be quite different from 0x7f7f7f7f for
instance, or a completely random number, so I don't want to judge ahead
of time.

> Nevertheless, I tested the patch and can confirm that there are no
> assertion failures anymore. 
> 
> I also ran it under ASAN and did not observe any issues.

Thanks for testing it.

> Would it make sense to add a test for this case from the bug report?

Sure, I would do that.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"Saca el libro que tu religión considere como el indicado para encontrar la
oración que traiga paz a tu alma. Luego rebootea el computador
y ve si funciona" (Carlos Duclós)



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Disallow direct use of the pgrepack logical decoding plugin