| От | Michael Paquier |
|---|---|
| Тема | Improve OOM handling in pg_locale.c |
| Дата | |
| Msg-id | CAB7nPqRMbGqa_mesopcn4MPyTs34eqtVEK7ELYxvvV=oqS00YA@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: Improve OOM handling in pg_locale.c
Re: Improve OOM handling in pg_locale.c |
| Список | pgsql-hackers |
Hi all, This is a follow-up of https://www.postgresql.org/message-id/11202.1472597262%40sss.pgh.pa.us where we are looking at improving OOM handling in the code. In short, report an ERROR appropriately instead of crashing. As mentioned in this message, pg_locale.c is trickier to handle because we had better not call elog() in a code path where the backend's locale are not set up appropriately. Attached is a patch aimed at fixing that, doing the following: - Copy into a temporary struct lconv the results from the call of localeconv() as those can be overwritten when restoring back the locales with setlocale(). - Use db_encoding_strdup to encode that correctly. - Switch back to the backend locales - Check for any strdup calls that returned NULL and elog() - If no error, fill in CurrentLocaleConv and return back to caller. I am attaching that to the next CF. Thanks, -- Michael
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера