Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace - Mailing list pgsql-bugs

From Jacob Champion
Subject Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace
Date
Msg-id CAOYmi+=+U2G+Nn0-f0DYS+Sm80c3Ez7wHZx4t8L=RwaT9P-AVQ@mail.gmail.com
Whole thread
In response to Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace
List pgsql-bugs
On Tue, Sep 15, 2026 at 2:43 PM Daniel Gustafsson <daniel@yesql.se> wrote:
> pstrdup calls strlen which segfault on NULL.  oauth_validator_libraries_string
> has a default value of "" so it cannot be set to NULL by user action, but the
> global variable backing the GUC is initialized as NULL so I wonder if it's
> worth adding defensive programming like the below, or perhaps an Assert?

It looks like there are no GUC_LIST_INPUT params with a NULL
.boot_val. I don't know if that's by design, but it's probably for the
best given the decision in ff4597acd4c.

There may be a bit of a tug-of-war going on between committers who
prefer the explicit Assert() crash vs committers who are fine with the
SEGV. (I prefer the assertion when it better documents intent, but at
time of authorship I'm not sure I would have wanted to argue about it.
:D)

Thanks,
--Jacob



pgsql-bugs by date:

Previous
From: Jeff Davis
Date:
Subject: TID Range Scans can return wrong results after scanning backwards
Next
From: Daniel Gustafsson
Date:
Subject: Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace