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

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: 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-06-08 18:03:35
Message-ID: aicBEBoCxhy_sk5j@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-May-27, Michael Paquier wrote:

> 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.

Right, done, thanks. I tested this by messing with pg_ctl's
004_logrotate.pl; as far as I can tell, it's all working fine.

I did notice that if you have an elog(WARNING) very early in syslogger,
it appears in postmaster's stderr only and not in the log files. I'm
not fussed about this ... as long as nothing crashes, it's fine.

> 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.

Yep, done and pushed.

I wondered if the MyBackendType changes could have an effect on
early-startup of other process types, but I couldn't find anything
actionable.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-06-08 18:12:15 Re: Fix domain fast defaults on empty tables
Previous Message Greg Burd 2026-06-08 17:50:58 Re: Add RISC-V Zbb popcount optimization