Re: edb-postgres.exe has encountered a problem on windows

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: edb-postgres.exe has encountered a problem on windows
Дата
Msg-id AANLkTin-xOjexQikNeL8sJga0Epp8a=Zf2y10PvzkuHc@mail.gmail.com
обсуждение исходный текст
Ответ на edb-postgres.exe has encountered a problem on windows  (Rushabh Lathia <rushabh.lathia@gmail.com>)
Список pgsql-hackers
On Fri, Apr 1, 2011 at 15:14, Rushabh Lathia <rushabh.lathia@gmail.com> wrote:
> 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.

What about the cases where we directly call write_console()? Do we
know we are good there, or should the check perhaps be made inside
write_console() instead of in the caller?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


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

Предыдущее
От: Rushabh Lathia
Дата:
Сообщение: edb-postgres.exe has encountered a problem on windows
Следующее
От: Shigeru HANADA
Дата:
Сообщение: Re: Comments on SQL/Med objects