Re: Add errdetail() with PID and UID about source of termination signal

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add errdetail() with PID and UID about source of termination signal
Date: 2026-04-16 08:34:58
Message-ID: CAKZiRmzSpX4C=3ou8VUJqX-RfQ+rNc9uw_Fn5gfD8NVctR4B3w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 16, 2026 at 8:09 AM Jakub Wartak
<jakub(dot)wartak(at)enterprisedb(dot)com> wrote:
>
> On Wed, Apr 15, 2026 at 9:39 PM Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> >
> >
> > On 2026-04-15 We 2:49 PM, Tom Lane wrote:
> >
> > Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> >
> > On 2026-04-15 We 12:04 PM, Tom Lane wrote:
> >
> > As a short-term fix, we could just go back to allowing the regex to
> > consider the match optional.
> >
> > Ok, so we can get the buildfarm green I'll go and do that. But I think
> > we should have an open item to tighten the test.
> >
> > I did some more digging, and got this from Google's AI Mode:
> >
> > -----
> > openbsd does not fill siginfo_t si_pid for SIGTERM
> >
> > On OpenBSD, si_pid is indeed not guaranteed to be filled for SIGTERM
> > (and many other signals), even when using SA_SIGINFO. This is a known
> > architectural behavior of the OpenBSD kernel rather than a bug.
> >
> > Why si_pid is zero or empty
> >
> > Minimalist Kernel Design: Unlike Linux, which often populates si_pid
> > and si_uid for most user-sent signals, the OpenBSD kernel only
> > guarantees these fields for specific signals where they are
> > functionally required by POSIX, such as SIGCHLD.
> >
> > Security & Information Leakage: OpenBSD has a history of limiting
> > information available across process boundaries to prevent
> > side-channel attacks or unnecessary information leaks about other
> > processes on the system [0.31].
> >
> > Signal Queueing: Standard signals like SIGTERM are not "queued" with
> > data in the same way real-time signals (which OpenBSD does not fully
> > support in the same manner as Linux) would be.
> > -----
> >
> > Now, none of the links it provided in support of these claims say
> > any such thing AFAICS, so maybe this is all an AI hallucination.
> > We could probably look into the OpenBSD kernel to check it, if we
> > were sufficiently motivated. But I'm inclined to believe it and
> > just say "this info is not available on all platforms, even some
> > that HAVE_SA_SIGINFO".
> >
> >
> >
> >
> >
> > Thanks for looking into this. I guess we could make a test to see what the platform will support, but it seems like overkill. So now I'm just inclined to go back to making the line completely optional in the test and leave it at that.
> >
>
> +1

And here is the patch for that.

-J.

Attachment Content-Type Size
v1-0001-Fix-test-about-the-lack-of-the-errdetail-signal-i.patch application/x-patch 1.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-04-16 08:45:55 Re: Reduce build times of pg_trgm GIN indexes
Previous Message Lakshmi N 2026-04-16 08:19:44 Reject invalid databases in pg_get_database_ddl()