From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: initdb SegFault
Date: Tue, 19 Nov 2019 12:06:50 -0500
Message-ID: <19334.1574183210@sss.pgh.pa.us> (raw)
In-Reply-To: <20191119161059.6styj2huulh4zrkw@alap3.anarazel.de>
References: <CALDaNm0ubwYDzbdYG5ezr6_qLodFM7KGoUJJJQQOBXe6_r=ZEQ@mail.gmail.com>
<7379.1574176562@sss.pgh.pa.us>
<20191119161059.6styj2huulh4zrkw@alap3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> Agreed wrt this specific failure scenario. It does however seem not
> great that callsites for PQExpBuffer ought to check every call for
> allocation failures, in the general case.
It is possible to check just once at the end, using the PQExpBufferBroken
API, and I believe that libpq for instance is fairly careful about that.
I agree that programs that just need to print something and exit could
perhaps ask pqexpbuffer.c to handle that for them. (But initdb still
doesn't fall in that category, because of its very nontrivial atexit
handler :-(.)
> I wonder if, for frontend paths, a simplified error handling path would
> be worthwhile for OOM paths. Doing only a write() or such to print an
> error message.
Perhaps. You wouldn't get any translation --- but then, gettext is
probably going to fail anyway under such conditions.
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, vignesh21@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: initdb SegFault
In-Reply-To: <19334.1574183210@sss.pgh.pa.us>
References: <CALDaNm0ubwYDzbdYG5ezr6_qLodFM7KGoUJJJQQOBXe6_r=ZEQ@mail.gmail.com> <7379.1574176562@sss.pgh.pa.us> <20191119161059.6styj2huulh4zrkw@alap3.anarazel.de> <19334.1574183210@sss.pgh.pa.us>
* 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