Re: initdb SegFault

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: initdb SegFault
Дата
Msg-id 19334.1574183210@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: initdb SegFault  (Andres Freund <andres@anarazel.de>)
Ответы Re: initdb SegFault  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: initdb SegFault
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Role membership and DROP