Re: pg crashing

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg crashing
Date: 2008-07-02 06:21:04
Message-ID: 486B1E50.7000300@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
> "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com> writes:
>> Version: "PostgreSQL 8.3.0, compiled by Visual C++ build 1400"
>
> Well, there are plenty of known bugs in 8.3.0 by now. You really
> should update before complaining, not after.

Yes. And the traditional question should be asked - is there any
antivirus or other "personal security" software running on tihs machine?
If so, uninstall (not just disable!) it and see if the problem goes away.

>> 2008-07-01 10:46:30 CDT LOG: all server processes terminated;
>> reinitializing
>
> I think your real problem is with what happened *before* that.

Agreed. There is some reason that they all terminated...

> But:
>> 2008-07-01 10:46:31 CDT FATAL: pre-existing shared memory block is
>> still in use
>> 2008-07-01 10:46:31 CDT HINT: Check if there are any old server
>> processes still running, and terminate them.
>
> Hmm ... the code in win32_shmem.c that generates this message seems
> mighty bogus to me --- it's just hoping that one-second delay is
> enough.

Well, we're basically waiting for the kernel cleanup thread to get run.
In my tests it never came above 20ms or so, so 1 second is a pretty long
time.

And you need *some* kind of timeout...

It would also be interesting to know if there are actually any other
processes running at this time.

> Another problem is that postmaster children that do
> PGSharedMemoryDetach will still have valid inherited handles for
> the shmem segment --- does that factor into the behavior? It looks
> to me like the CloseHandle ought to be in PGSharedMemoryDetach.

Not as long as the processes die. If they die, their handles go with
them, and once the reference count goes to zero, the object goes away.

//Magnus

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-07-02 06:26:23 Re: pg crashing
Previous Message Bjørn T Johansen 2008-07-02 06:19:45 Target lists can have at most 1664 entries?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-07-02 06:23:26 Re: Limits of backwards compatibility for psql's \d commands
Previous Message Joshua D. Drake 2008-07-02 05:32:14 Re: Limits of backwards compatibility for psql's \d commands