edb-postgres.exe has encountered a problem on windows

Поиск
Список
Период
Сортировка
От Rushabh Lathia
Тема edb-postgres.exe has encountered a problem on windows
Дата
Msg-id AANLkTi=NatGM-Q+=4Fe5M2auYoWyhacxwvgx2ttjkqwJ@mail.gmail.com
обсуждение исходный текст
Ответы Re: edb-postgres.exe has encountered a problem on windows  (Magnus Hagander <magnus@hagander.net>)
Re: edb-postgres.exe has encountered a problem on windows  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Problem:
========

On windows when we run edb-postgres.exe without any command line args, its getting crash or its showing error into Application logs of Event Viewer.

Analysis:
==========

For any stderr we call the write_stderr() and write_stderr() calls the write_console() for stderr. Now here write_console() using the palloc() internally, which require the CurrentMemoryContext.

At the startup CurrentMemoryContext will be NULL, so palloc again calling write_stderr(). So recursion has been started and its ending up with exception.

Call stack for palloc() is:

main() -> check_root() -> write_stderr() -> write_console() -> pgwin32_toUTF16() -> palloc()

Fix:
=====

Earlier  we used to call vfprintf() for windows stderr, which is now replaced with write_console().
So to avoid the exception now, I added condition for CurrentMemoryContext into write_stderr().

PFA patch to fix the same.

Regards,
Rushabh Lathia
EnterpriseDB, The Enterprise PostgreSQL company.

Вложения

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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: Foreign table permissions and cloning
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: edb-postgres.exe has encountered a problem on windows