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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: euler(at)eulerto(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, alvherre(at)kurilemu(dot)de
Subject: Re: NULL pointer dereference in syslogger with load_libraries() and -DEXEC_BACKEND at startup
Date: 2026-05-26 05:52:00
Message-ID: ahU1AIsL3QJOONRG@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 26, 2026 at 02:39:12PM +0900, Kyotaro Horiguchi wrote:
> In write_syslogger_file, there's already a fallback path to
> write_stderr() when fwrite fails. Would it make sense to treat logfile
> == NULL as an error case as well?

It does not make much sense to me. A write failure is based on the
fact that something went wrong in the underlying OS, most likely in
the file system, and that's not something Postgres has any idea about.
This issue is different, it is a Postgres logic bug, so adding an
exception like the one you are suggesting is just a shortcut hiding
the real issue: the log file is not ready yet, but the syslogger is
invoked at a point when it thinks the log file exists.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-05-26 05:53:51 Re: Proposal: Conflict log history table for Logical Replication
Previous Message shveta malik 2026-05-26 05:50:03 Re: [PATCH] Release replication slot on error in SQL-callable slot functions