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

2019-11-11 Thread Michael Paquier
On Mon, Nov 11, 2019 at 09:02:01AM +0900, Michael Paquier wrote: > Thanks for your input, Tom. This matches with my opinion about this > thread and this patch. And switched the CF entry of the patch as rejected. -- Michael signature.asc Description: PGP signature

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

2019-11-10 Thread Michael Paquier
On Sun, Nov 10, 2019 at 11:24:34AM -0500, Tom Lane wrote: > I feel the pain on this --- indirect dependencies are not well reported > on any platform that I deal with :-(. Still, I'm having a hard time > convincing myself that this patch is a good idea. It seems very likely > that it will break

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

2019-11-10 Thread Tom Lane
Michael Paquier writes: > On Sun, Nov 10, 2019 at 06:03:08PM +0800, Craig Ringer wrote: >> I had to go hunt around with Dependency Walker to figure out the actual >> missing DLL the last time I had to deal with this. > Ahah. Yes, That's exactly what I used a couple of years back on that. >

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

2019-11-10 Thread Michael Paquier
On Sun, Nov 10, 2019 at 06:03:08PM +0800, Craig Ringer wrote: > I had to go hunt around with Dependency Walker to figure out the actual > missing DLL the last time I had to deal with this. Ahah. Yes, That's exactly what I used a couple of years back on that. These errors are hard to track and

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

2019-11-10 Thread Craig Ringer
On Mon, 23 Jul 2018 at 16:45, Michael Paquier wrote: > On Mon, Jul 23, 2018 at 08:16:52AM +, Tsunakawa, Takayuki wrote: > > I guess that is due to some missing files related to the libraries > > listed in shared_preload_library. If so, no, because this patch > > relates to failure before

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

2019-11-10 Thread Craig Ringer
On Wed, 18 Jul 2018 at 12:10, Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > At Wed, 18 Jul 2018 11:12:06 +0800, Craig Ringer > wrote in yqtpidgg...@mail.gmail.com> > > On 26 February 2018 at 12:06, Tsunakawa, Takayuki < > > tsunakawa.ta...@jp.fujitsu.com> wrote: > > > > > From:

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

2019-11-06 Thread Michael Paquier
On Wed, Sep 11, 2019 at 01:55:45PM +0900, Michael Paquier wrote: > Okay, so this means that the service state of the parent is inherited > and that we can rely on that. I was not sure about that. Got it > now. Now, there are cases where it is possible to start an app > without using a service

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

2019-09-10 Thread Michael Paquier
On Wed, Sep 11, 2019 at 04:15:24AM +, Tsunakawa, Takayuki wrote: > From: Michael Paquier [mailto:mich...@paquier.xyz] >> Imagine an application which relies on Postgres, still does *not* start >> it as a service but uses "pg_ctl start" >> automatically. This could be triggered as part of

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

2019-09-10 Thread Tsunakawa, Takayuki
From: Michael Paquier [mailto:mich...@paquier.xyz] > Imagine an application which relies on Postgres, still does *not* start > it as a service but uses "pg_ctl start" > automatically. This could be triggered as part of another service startup > which calls say system(), or as another script.

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

2019-09-10 Thread Michael Paquier
On Tue, Sep 10, 2019 at 06:44:48AM +, Tsunakawa, Takayuki wrote: > 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

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

2019-09-10 Thread Alvaro Herrera from 2ndQuadrant
On 2019-Sep-10, Tsunakawa, Takayuki wrote: > Agreed. Fixed. I changed the CF status to "need review." I have changed it again to "ready for committer". We could really use help from a windows-enabled committer on this patch, I think. -- Álvaro Herrera

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

2019-09-10 Thread Tsunakawa, Takayuki
From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Alvaro Herrera from 2ndQuadrant 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

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

2019-09-06 Thread Tom Lane
Alvaro Herrera from 2ndQuadrant writes: > On 2019-Sep-05, Tom Lane wrote: >> [ confused... ] I haven't been paying attention to this thread, >> but is it really something we'd push into v12 at this point? > Well, IMV this is a backpatchable, localized bug fix. I dunno. This thread is

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

2019-09-06 Thread Alvaro Herrera from 2ndQuadrant
On 2019-Sep-05, Tom Lane wrote: > Alvaro Herrera from 2ndQuadrant writes: > > Tsunakawa-san, there's been some discussion downthread. Could you > > please submit an updated version of the patch? I would like to get it > > pushed before beta4 next week, if possible. > > [ confused... ] I

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

2019-09-06 Thread Tsunakawa, Takayuki
From: Michael Paquier [mailto:mich...@paquier.xyz] > The last patch submitted is here: > https://www.postgresql.org/message-id/0A3221C70F24FB45833433255569204D > 1F8ECF73@G01JPEXMBYT05 > And based on the code paths it touches I would recommend to not play with > REL_12_STABLE at this stage. I'm

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

2019-09-05 Thread Michael Paquier
On Thu, Sep 05, 2019 at 11:49:03PM -0400, Tom Lane wrote: > Alvaro Herrera from 2ndQuadrant writes: >> Tsunakawa-san, there's been some discussion downthread. Could you >> please submit an updated version of the patch? I would like to get it >> pushed before beta4 next week, if possible. > > [

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

2019-09-05 Thread Tom Lane
Alvaro Herrera from 2ndQuadrant writes: > Tsunakawa-san, there's been some discussion downthread. Could you > please submit an updated version of the patch? I would like to get it > pushed before beta4 next week, if possible. [ confused... ] I haven't been paying attention to this thread, but

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

2019-09-05 Thread Alvaro Herrera from 2ndQuadrant
On 2019-Jul-01, Tsunakawa, Takayuki wrote: > From: Amit Kapila [mailto:amit.kapil...@gmail.com] > > Tsunakawa/Haribabu - By reading this thread briefly, it seems we need > > some more inputs from other developers on whether to fix this or not, > > so ideally the status of this patch should be

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

2019-07-24 Thread Alvaro Herrera
On 2019-Jul-24, Kyotaro Horiguchi wrote: > Hello. > > On Wed, Jul 24, 2019 at 2:31 AM Alvaro Herrera > wrote: > > > > On 2019-Jul-23, Tom Lane wrote: > > > > > Kyotaro Horiguchi writes: > > > > > > My investigation convinced me that there is no way for a process > > > > to detect wheter it is

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

2019-07-24 Thread Kyotaro Horiguchi
Hello. On Wed, Jul 24, 2019 at 2:31 AM Alvaro Herrera wrote: > > On 2019-Jul-23, Tom Lane wrote: > > > Kyotaro Horiguchi writes: > > > > My investigation convinced me that there is no way for a process > > > to detect wheter it is running as a service (except the process > > > directly called

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

2019-07-23 Thread Alvaro Herrera
On 2019-Jul-23, Tom Lane wrote: > Kyotaro Horiguchi writes: > > My investigation convinced me that there is no way for a process > > to detect wheter it is running as a service (except the process > > directly called from system (aka entry function)). Maybe we can try calling

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

2019-07-23 Thread Tom Lane
Kyotaro Horiguchi writes: > We are obliged to assume that we won't have the desired behavior > without detecting whether running as a service or not. > My investigation convinced me that there is no way for a process > to detect wheter it is running as a service (except the process > directly

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

2019-07-23 Thread Kyotaro Horiguchi
At Mon, 1 Jul 2019 00:04:47 +, "Tsunakawa, Takayuki" wrote in <0A3221C70F24FB45833433255569204D1FC6515F@G01JPEXMBYT05> > From: Amit Kapila [mailto:amit.kapil...@gmail.com] > > Tsunakawa/Haribabu - By reading this thread briefly, it seems we need > > some more inputs from other developers on

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

2019-06-30 Thread Tsunakawa, Takayuki
From: Amit Kapila [mailto:amit.kapil...@gmail.com] > Tsunakawa/Haribabu - By reading this thread briefly, it seems we need > some more inputs from other developers on whether to fix this or not, > so ideally the status of this patch should be 'Needs Review'. Why it > is in 'Waiting on Author'

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

2019-06-28 Thread Amit Kapila
On Tue, Nov 6, 2018 at 10:24 AM Haribabu Kommi wrote: > > On Thu, Jul 26, 2018 at 3:52 PM Tsunakawa, Takayuki > wrote: > > > Thanks for confirmation of that PostgreSQL runs as service. > > Based on the following details, we can decide whether this fix is required or > not. > 1. Starting of

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

2019-03-06 Thread Kyotaro HORIGUCHI
Hello. At Tue, 5 Mar 2019 16:45:53 +1100, Haribabu Kommi wrote in > > I don't have an idea about which is better behavior, but does > > this work for you? > > > > > > https://docs.microsoft.com/en-us/windows/desktop/wer/collecting-user-mode-dumps > > > > No, this option is not generating

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

2019-03-04 Thread Haribabu Kommi
On Mon, Mar 4, 2019 at 3:23 PM Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > Hello. > > At Tue, 6 Nov 2018 15:53:37 +1100, Haribabu Kommi < > kommi.harib...@gmail.com> wrote in < > cajrrpgcxzi4z_sttnuuvyoaw+sadk7+cjgypuf7ao43vujl...@mail.gmail.com> > > Thanks for confirmation of

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

2019-03-03 Thread Kyotaro HORIGUCHI
Hello. At Tue, 6 Nov 2018 15:53:37 +1100, Haribabu Kommi wrote in > Thanks for confirmation of that PostgreSQL runs as service. > > Based on the following details, we can decide whether this fix is required > or not. > 1. Starting of Postgres server using pg_ctl without service is of >

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

2018-11-05 Thread Haribabu Kommi
On Thu, Jul 26, 2018 at 3:52 PM Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Michael Paquier [mailto:mich...@paquier.xyz] > > No, I really mean a library dependency failure. For example, imagine > that > > Postgres is compiled on Windows dynamically, and that it depends

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

2018-07-25 Thread Tsunakawa, Takayuki
From: Michael Paquier [mailto:mich...@paquier.xyz] > No, I really mean a library dependency failure. For example, imagine that > Postgres is compiled on Windows dynamically, and that it depends on > libxml2.dll, which is itself compiled dynamically. Then imagine, in a > custom build echosystem,

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

2018-07-23 Thread Amit Kapila
On Mon, Jul 23, 2018 at 12:56 PM, Michael Paquier wrote: > On Mon, Jul 23, 2018 at 01:31:57AM +, Tsunakawa, Takayuki wrote: >> First, as Hari-san said, starting the server with "pg_ctl start" on >> the command prompt does not feel like production use but like test >> environment, and that

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

2018-07-23 Thread Michael Paquier
On Mon, Jul 23, 2018 at 08:16:52AM +, Tsunakawa, Takayuki wrote: > I guess that is due to some missing files related to the libraries > listed in shared_preload_library. If so, no, because this patch > relates to failure before main(). No, I really mean a library dependency failure. For

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

2018-07-23 Thread Tsunakawa, Takayuki
From: Michael Paquier [mailto:mich...@paquier.xyz] > When you use pg_ctl start within the command prompt, then closing the prompt > session also causes Postgres to stop immediately. Would it be a problem? No. But that makes me think more of the startup on command prompt as non-production

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

2018-07-23 Thread Michael Paquier
On Mon, Jul 23, 2018 at 01:31:57AM +, Tsunakawa, Takayuki wrote: > First, as Hari-san said, starting the server with "pg_ctl start" on > the command prompt does not feel like production use but like test > environment, and that usage seems mostly interactive. Second, the > current PostgreSQL

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

2018-07-23 Thread Michael Paquier
On Mon, Feb 26, 2018 at 04:06:48AM +, Tsunakawa, Takayuki wrote: > As for PG11+, I agree that we want to always leave WER on. That is, > call SetErrorMode(SEM_FAILCRITICALERRORS) but not specify > SEM_NOGPFAULTERRORBOX. The problem with the current specification of > PostgreSQL is that the

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

2018-07-22 Thread Tsunakawa, Takayuki
From: Robert Haas [mailto:robertmh...@gmail.com] > On Wed, Jul 18, 2018 at 4:38 AM, Tsunakawa, Takayuki > wrote: > > 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

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

2018-07-20 Thread Robert Haas
On Wed, Jul 18, 2018 at 4:38 AM, Tsunakawa, Takayuki wrote: > 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. Hmm. I think that might be bad. What makes you

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

2018-07-19 Thread Haribabu Kommi
On Wed, Jul 18, 2018 at 6:39 PM Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Haribabu Kommi [mailto:kommi.harib...@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

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

2018-07-18 Thread Tsunakawa, Takayuki
From: Haribabu Kommi [mailto:kommi.harib...@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! > My point is, With this patch, in case if the postgres crashses > before reaching main(), does it

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

2018-07-18 Thread Haribabu Kommi
On Wed, Jul 18, 2018 at 4:10 PM Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Haribabu Kommi [mailto:kommi.harib...@gmail.com] > > I reviewed patch and it works as per the subject, but I am not able to > verify > > the actual > > bug that is reported in the upthread. The

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

2018-07-18 Thread Craig Ringer
On 18 July 2018 at 14:34, Michael Paquier wrote: > On Wed, Jul 18, 2018 at 06:09:57AM +, Tsunakawa, Takayuki wrote: > > From: Haribabu Kommi [mailto:kommi.harib...@gmail.com] > >> I reviewed patch and it works as per the subject, but I am not able to > verify > >> the actual > >> bug that is

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

2018-07-18 Thread Michael Paquier
On Wed, Jul 18, 2018 at 06:09:57AM +, Tsunakawa, Takayuki wrote: > From: Haribabu Kommi [mailto:kommi.harib...@gmail.com] >> I reviewed patch and it works as per the subject, but I am not able to verify >> the actual >> bug that is reported in the upthread. The moving of setErrorMode() call >>

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

2018-07-18 Thread Tsunakawa, Takayuki
From: Haribabu Kommi [mailto:kommi.harib...@gmail.com] > I reviewed patch and it works as per the subject, but I am not able to verify > the actual > bug that is reported in the upthread. The moving of setErrorMode() call > to the start > of the main function can handle all the cases that can lead

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

2018-07-17 Thread Kyotaro HORIGUCHI
At Wed, 18 Jul 2018 11:12:06 +0800, Craig Ringer wrote in > On 26 February 2018 at 12:06, Tsunakawa, Takayuki < > tsunakawa.ta...@jp.fujitsu.com> wrote: > > > From: Craig Ringer [mailto:cr...@2ndquadrant.com] > > > The patch proposed here means that early crashes will invoke WER. If > > we're

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

2018-07-17 Thread Craig Ringer
On 26 February 2018 at 12:06, Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Craig Ringer [mailto:cr...@2ndquadrant.com] > > The patch proposed here means that early crashes will invoke WER. If > we're > > going to allow WER we should probably just do so unconditionally. > >

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

2018-07-17 Thread Haribabu Kommi
On Thu, Mar 1, 2018 at 4:14 PM Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Tsunakawa, Takayuki [mailto:tsunakawa.ta...@jp.fujitsu.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

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

2018-02-28 Thread Tsunakawa, Takayuki
From: Tsunakawa, Takayuki [mailto:tsunakawa.ta...@jp.fujitsu.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) > { >

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

2018-02-21 Thread Craig Ringer
On 20 February 2018 at 23:43, Magnus Hagander wrote: > > I've seen a number of usecases where apps start it alongside the app > instead of as a service. I'm not sure how recent those apps are though, and > I'm not sure it's better than using a service in the first place (but

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

2018-02-20 Thread Magnus Hagander
On Tue, Feb 20, 2018 at 3:18 PM, Craig Ringer wrote: > On 20 February 2018 at 21:47, Magnus Hagander wrote: > >> >> >> On Fri, Feb 16, 2018 at 8:28 AM, Tsunakawa, Takayuki < >> tsunakawa.ta...@jp.fujitsu.com> wrote: >> >>> Hello, >>> >>> postgres.exe

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

2018-02-20 Thread Craig Ringer
On 20 February 2018 at 22:18, Craig Ringer wrote: > So I'm all for just removing that. > ... but just to be clear, about -1000 on backpatching any such thing. At most, a new GUC that defaults to the current behaviour. But I think it's pretty niche really. -- Craig

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

2018-02-20 Thread Craig Ringer
On 20 February 2018 at 21:47, Magnus Hagander wrote: > > > On Fri, Feb 16, 2018 at 8:28 AM, Tsunakawa, Takayuki < > tsunakawa.ta...@jp.fujitsu.com> wrote: > >> Hello, >> >> postgres.exe on Windows doesn't output a crash dump when it crashes >> before main() is called. The

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

2018-02-20 Thread Magnus Hagander
On Fri, Feb 16, 2018 at 8:28 AM, Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > 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