Re: Improve OOM handling in pg_locale.c

Поиск
Список
Период
Сортировка
От Mithun Cy
Тема Re: Improve OOM handling in pg_locale.c
Дата
Msg-id CAD__OujDqK8xmpW6xVM-SDNCP=-hf3Czr-m=o-JZKa=bjbTLgw@mail.gmail.com
обсуждение исходный текст
Ответ на Improve OOM handling in pg_locale.c  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Improve OOM handling in pg_locale.c
Список pgsql-hackers
On Thu, Oct 13, 2016 at 1:40 PM, Michael Paquier <michael.paquier@gmail.com> wrote:
> I am attaching that to the next CF.

I have tested this patch. Now we error out as OOM instead of crash.
------------------------------------------------
postgres=# SELECT '12.34'::money;
ERROR:  out of memory
LINE 1: SELECT '12.34'::money;
------------------------------------------------

One thing which you might need to reconsider is removal of memory leak comments. There is still a leak if there is an error while encoding in db_encoding_strdup. Unless you want to catch those error with an TRY();....CATCH(); and then free the mem.
-	 * localeconv()'s results.  Note that if we were to fail within this
-	 * sequence before reaching "CurrentLocaleConvAllocated = true", we could
-	 * leak some memory --- but not much, so it's not worth agonizing over.

Rest all LGTM.

--
Thanks and Regards
Mithun C Y

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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Document how to set up TAP tests for Perl 5.8.8
Следующее
От: Robert Haas
Дата:
Сообщение: Re: pg_dump versus rules, once again