| From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
|---|---|
| To: | Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com> |
| Cc: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-05-01 17:26:51 |
| Message-ID: | CAD5tBcKf0mjcSpVDu4BVFe3qNMG5bPqpUETzEodo8Gduo1DZ1w@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Apr 23, 2026 at 6:20 AM Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
wrote:
> On Thu, Apr 23, 2026 at 11:28 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
> Hi Chao
>
> >
> > I just got a suspicion about this feature. The repro is very simple: let
> a normal user connect to the server, then run pg_ctl stop, and from psql
> you get:
> > ```
> > evantest=> select 1;
> > FATAL: terminating connection due to administrator command
> > DETAIL: Signal sent by PID 17523, UID 501.
> > server closed the connection unexpectedly
> > This probably means the server terminated abnormally
> > before or while processing the request.
> > The connection to the server was lost. Attempting reset: Failed.
> > The connection to the server was lost. Attempting reset: Failed.
> > !?>
> > ```
> >
> > Do we really need to show the DETAIL message with the PID and UID to an
> ordinary client? Is there any concern about leaking the UID in a shared
> production deployment?
> >
> > If this is confirmed an issue, I made a simple fix by using
> errdetail_log() to only emit the detail message to server log. Please the
> attached diff file.
>
> +1, I think logging just to file is even better than sending it to the
> client(s) and it also solves the potential security risk (if any).
>
>
> I agree, I have pushed the patch.
cheers
andrew
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Robert Haas | 2026-05-01 17:30:38 | Re: Why clearing the VM doesn't require registering vm buffer in wal record |
| Previous Message | Henson Choi | 2026-05-01 17:11:00 | Re: Row pattern recognition |