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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, 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-05-27 01:09:39
Message-ID: ahZEU_1Q0X9j3TVm@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 26, 2026 at 09:13:30PM -0300, Euler Taveira wrote:
> As I said I'm fine with your proposed patch.

With the patch posted at [1] in place, the problem is indeed gone.

My first reaction is that we may want to update the two code paths of
csvlog.c and jsonlog.c with a similar check, switching away from
MyBackendType to your new syslogger_setup_done. That would be more
defensive in the long-term if someone has the idea to refactor or
reshape this code.

It also looks important to me to plant a few comments to document the
purpose of the flag (which is I'm sure something you were going to
do). It is not complicated to see what's the purpose by grepping for
syslogger_setup_done, but it would be less guessing for the reader.

Keeping redirection_done out of this decision-making logic sounds
indeed wiser, the flag serves a different purpose..

As a whole, I'm fine with this idea.

[1]: https://www.postgresql.org/message-id/ahV9KzLOqvOw78C3%40alvherre.pgsql
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2026-05-27 01:28:51 Re: Fix bug of UPDATE/DELETE FOR PORTION OF with inheritance tables
Previous Message Amit Kapila 2026-05-27 00:44:29 Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server