[bug fix] Produce a crash dump before main() on Windows

Поиск
Список
Период
Сортировка
От Tsunakawa, Takayuki
Тема [bug fix] Produce a crash dump before main() on Windows
Дата
Msg-id 0A3221C70F24FB45833433255569204D1F8B6944@G01JPEXMBYT05
обсуждение исходный текст
Ответы Re: [bug fix] Produce a crash dump before main() on Windows
Список pgsql-hackers
Hello,

postgres.exe on Windows doesn't output a crash dump when it crashes before main() is called.  The attached patch fixes
this. I'd like this to be back-patched.  I'll add this to the next CF.
 

The original problem happened on our customer's production system.  Their application sometimes failed to connect to
thedatabase.  That was because postgres.exe crashed due to access violation (exception code C0000005).  But there was
nocrash dump, so we had difficulty in finding the cause.  The frequency was low -- about ten times during half a year.
 

What caused the access violation was Symantec's antivirus software.  It seems that sysfer.dll of the software
interceptsregistry access, during C runtime library initialization,  before main() is called.  So, the direct cause of
thisproblem is not PostgreSQL.
 

On the other hand, it's PostgreSQL's problem that we can't get the crash dump, which makes the investigation difficult.
The cause is that postmaster calls SetErrorMode() to disable the outputing of crash dumps by WER (Windows Error
Reporting). This error mode is inherited from postmaster to its children.  If a crash happens before the child sets up
theexception handler, no crash dump is produced.
 


Regards
Takayuki Tsunakawa


Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [bug fix] Cascaded standby cannot start after a clean shutdown
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [bug fix] Cascaded standby cannot start after a clean shutdown