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

From Tsunakawa, Takayuki
Subject RE: [bug fix] Produce a crash dump before main() on Windows
Date
Msg-id 0A3221C70F24FB45833433255569204D1FD31284@G01JPEXMBYT05
Whole thread Raw
In response to Re: [bug fix] Produce a crash dump before main() on Windows  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [bug fix] Produce a crash dump before main() on Windows
Re: [bug fix] Produce a crash dump before main() on Windows
List pgsql-hackers
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Alvaro Herrera from 2ndQuadrant <alvherre@alvh.no-ip.org> writes:
> > Well, IMV this is a backpatchable, localized bug fix.
> 
> I dunno.  This thread is approaching two years old, and a quick
> review shows few signs that we actually have any consensus on
> making behavioral changes here.  If there is any consensus,
> it's that the SetErrorMode calls should depend on checking
> pgwin32_is_service(); but we haven't even seen a patch that
> does that, let alone tested it.  I think we're way too close
> to beta4 wrap to be considering pushing such a patch the moment
> it appears.

We don't have to call pgwin32_is_service() to determine whether we call SetErrorMode() in postmaster.c because:

* The dialog box doesn't appear under Windows service, whether PostgreSQL itself starts as a service or another
(server)application runs as a service and does "pg_ctl start."
 

* It's OK for the dialog box to appear when the user runs "pg_ctl start" on the command prompt.  That usage is
interactive,and should not be for production use (postgres processes vanish when the user mistakenly presses Ctrl+C, or
closesthe command prompt).  Even now, the dialog box pops up if postmaster crashes before main().
 


> BTW, I also violently dislike taking Windows-specific stuff out of
> startup_hacks where it belongs and putting it into main() where
> it doesn't.  I think the entire Windows bit in front of get_progname
> should migrate into startup_hacks.  Surely the odds of failure
> inside get_progname are not worth worrying about --- they seem
> significantly less than the odds of failure inside
> pgwin32_is_service(), for instance.

Agreed.  Fixed.  I changed the CF status to "need review."


Regards
Takayuki Tsunakawa


Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [patch]socket_timeout in interfaces/libpq
Next
From: Richard Guo
Date:
Subject: Pulling up direct-correlated ANY_SUBLINK