Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chris Travers <chris(at)metatrontech(dot)com>, Cristian Bittel <cbittel(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session
Date: 2010-09-10 12:45:46
Message-ID: 201009101245.o8ACjkD21094@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Magnus Hagander wrote:
> > I think we have clear enough evidence that 128 on Win32 means
> > no-such-child and we can be sure the child never got started on that
> > platform.
>
> We have evidence that 128 occurs in this case. I don't think we have
> evidence that there is no other case when this can happen, and we need
> to investigate that some further to be *sure*.
>
> We can safely say that *we* never do exit(128). What if a third party
> library does it? Or the operating system itself? For the OS we can
> check it, but do we care about third party libraries?

Good question. Unix wait() splits apart the return code so you can tell
which part is the process exit code and which part is extra:

WEXITSTATUS(status)
If WIFEXITED(status) is true, evaluates to the low-order 8 bits
of the argument passed to _exit(2) or exit(3) by the child.

but we don't have that split on Win32 so you are right that anything
could return 128 from the process. Of course, it could also return
exit(0) too, but would hope that nothing does that as an error return.

I am not sure how clear it is on Win32 that 128 is a special return
code.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mladen Gogala 2010-09-10 13:01:58 BUG #5652: Optimizer does wrong thing with partitioned tables
Previous Message Michael Felt 2010-09-10 12:26:48 Re: Before I call it a bug - some comments and questions

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2010-09-10 12:56:25 Re: Walsender doesn't process options passed in the startup packet
Previous Message Heikki Linnakangas 2010-09-10 10:54:54 Re: Walsender doesn't process options passed in the startup packet