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

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: 'Craig Ringer' <craig(at)2ndquadrant(dot)com>, Magnus Hagander<magnus(at)hagander(dot)net>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: [bug fix] Produce a crash dump before main() on Windows
Date: 2018-03-01 05:13:34
Message-ID: 0A3221C70F24FB45833433255569204D1F8ECF73@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

From: Tsunakawa, Takayuki [mailto:tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com]
> Another idea to add to the current patch is to move the call to SetErrorMode()
> to the below function, which is called first in main(). How about this?
>
> void
> pgwin32_install_crashdump_handler(void)
> {
> SetUnhandledExceptionFilter(crashDumpHandler);
> }

I moved SetErrorMode() to the beginning of main(). It should be placed before any code which could crash. The current location is a bit late: in fact, write_stderr() crashed when WSAStartup() failed.

Regards
Takayuki Tsunakawa

Attachment Content-Type Size
crash_dump_before_main_v2.patch application/octet-stream 1.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Arseny Sher 2018-03-01 05:17:33 Why chain of snapshots is used in ReorderBufferCommit?
Previous Message Ashutosh Bapat 2018-03-01 05:02:43 Re: [HACKERS] path toward faster partition pruning