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

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] Produce a crash dump before main() on Windows
Date: 2018-07-19 12:55:44
Message-ID: CAJrrPGfrtFn5+uTYxhekYA25GBMcr8jXKQd-e=CpEYxPnxgQ7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 18, 2018 at 6:39 PM Tsunakawa, Takayuki <
tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:

> From: Haribabu Kommi [mailto:kommi(dot)haribabu(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2018-07-19 12:59:28 Re: Libpq support to connect to standby server as priority
Previous Message Pavel Stehule 2018-07-19 12:50:35 Re: [HACKERS] plpgsql - additional extra checks