pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't use abort(3) in libpq's fe-print.c.
Date: Mon, 28 Jun 2021 18:18:05 +0000
Message-ID: <E1lxvpd-000876-91@gemulon.postgresql.org> (raw)

Don't use abort(3) in libpq's fe-print.c.

Causing a core dump on out-of-memory seems pretty unfriendly,
and surely is far outside the expected behavior of a general-purpose
library.  Just print an error message (as we did already) and return.
These functions unfortunately don't have an error return convention,
but code using them is probably just looking for a quick-n-dirty
print method and wouldn't bother to check anyway.

Although these functions are semi-deprecated, it still seems
appropriate to back-patch this.  In passing, also back-patch
b90e6cef1, just to reduce cosmetic differences between the
branches.

Discussion: https://postgr.es/m/3122443.1624735363@sss.pgh.pa.us

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/240d56fc4351a6729ec9ddf94a3d338a1e4868ab

Modified Files
--------------
src/interfaces/libpq/fe-print.c | 81 ++++++++++++++++++++++++-----------------
1 file changed, 47 insertions(+), 34 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1lxvpd-000876-91@gemulon.postgresql.org>
Permalink:  ../E1lxvpd-000876-91@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lxvpd-000876-91@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Don't use abort(3) in libpq's fe-print.c.
  In-Reply-To: <E1lxvpd-000876-91@gemulon.postgresql.org>
  References: <E1lxvpd-000876-91@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox