Re: NULL pointer dereference in syslogger with load_libraries() and -DEXEC_BACKEND at startup

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Anton Voloshin <a(dot)voloshin(at)postgrespro(dot)ru>, Euler Taveira <euler(at)eulerto(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: NULL pointer dereference in syslogger with load_libraries() and -DEXEC_BACKEND at startup
Date: 2026-07-16 00:15:18
Message-ID: algiltRh8fHYZD0s@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 15, 2026 at 06:14:30PM +0200, Alvaro Herrera wrote:
> Michael, looking at
> https://github.com/michaelpq/pg_plugins/blob/main/jsonlog/jsonlog.c
> do you see an issue with this variable?

I have not directly tested it yet (will perhaps do so later this
week or later), but I am pretty sure that this module is broken as-is
with v19 under EXEC_BACKEND. Not checking for syslogger_setup_done
and only redirection_done means that the module could try to send some
chunks of data to the syslogger without the file handles being set,
crashing the syslogger the same way as what I have done upthread.

I have created an item to look at that later, for now:
https://github.com/michaelpq/pg_plugins/issues/56

AFAIK, jsonlog is still used in some container setups even with the
in-core option in place since v15, folks have been keeping asking for
it. I suspect that there is close to zero use of it under
EXEC_BACKEND, but we surely should fix the issue anyway..
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2026-07-16 00:26:27 Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows
Previous Message Masahiko Sawada 2026-07-16 00:09:15 Follow-up fixes for online wal_level change