Skip site navigation (1) Skip section navigation (2)

edb-postgres.exe has encountered a problem on windows

From: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Rushabh Lathia <rushabh(dot)lathia(at)enterprisedb(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Subject: edb-postgres.exe has encountered a problem on windows
Date: 2011-04-01 13:14:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

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.


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

Call stack for palloc() is:

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


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.

Rushabh Lathia
EnterpriseDB <>, The Enterprise

Attachment: win_crash_fix.patch
Description: text/x-diff (954 bytes)


pgsql-hackers by date

Next:From: Magnus HaganderDate: 2011-04-01 13:21:07
Subject: Re: edb-postgres.exe has encountered a problem on windows
Previous:From: Thom BrownDate: 2011-04-01 12:13:54
Subject: Re: Foreign table permissions and cloning

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group