Re: [bug fix] Produce a crash dump before main() on Windows - Mailing list pgsql-hackers

From Haribabu Kommi
Subject Re: [bug fix] Produce a crash dump before main() on Windows
Date
Msg-id CAJrrPGfrtFn5+uTYxhekYA25GBMcr8jXKQd-e=CpEYxPnxgQ7Q@mail.gmail.com
Whole thread Raw
In response to RE: [bug fix] Produce a crash dump before main() on Windows  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
List pgsql-hackers

On Wed, Jul 18, 2018 at 6:39 PM Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com> wrote:
From: Haribabu Kommi [mailto:kommi.haribabu@gmail.com]
> May be I can give a try by modifying the source code to get the crash.


Thank you, that would be great if you could come up with a good way!

+       if (argc > 1 && strncmp(argv[1], "--fork", 6) == 0)
+       {
+               char *ptr = NULL;
+
+               printf ("%s",*ptr);
+       }
+

I added the above code as first execution code in main() function and I am able to
reproduce the WER popup.

 
> My point is, With this patch, in case if the postgres crashses
> before reaching main(), does it generate a popup?
>
> If the answer to the above question is yes, then if the popup is
> not attended by the DBA, I feel the postmaster is not able to
> restart all the processes because it is waiting for the crash process
> to close. Am I Correct?

IIRC, the pop up doesn't appear under Windows service.  If you start the database server with pg_ctl start on the command prompt, the pop up will appear, which I think is not bad.

Yes, the popup doesn't appear when it is started as service and appear when it is started from command prompt.
I also think that scenarios of starting the server from command prompt may be less, so this patch can be useful
to find out the issue by the starting the server from command prompt. 

I marked the patch as "ready for committer".

Regards,
Haribabu Kommi
Fujitsu Australia

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] plpgsql - additional extra checks
Next
From: Haribabu Kommi
Date:
Subject: Re: Libpq support to connect to standby server as priority