pre-existing shared memory block is still in use after crashes

Поиск
Список
Период
Сортировка
Искать

pre-existing shared memory block is still in use after crashes

От:
Dave Vitek <dvitek@grammatech.com>
Дата:
Hi all,

Yesterday I ran into two backend crashes and then an autovacuum launcher 
process crash.  The autovacuum log was:
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher process (PID 3788) was terminated by exception 
0xC0000142
HINT:  See C include file "ntstatus.h" for a description of the 
hexadecimal value.
LOG:  terminating any other active server processes
LOG:  all server processes terminated; reinitializing
FATAL:  pre-existing shared memory block is still in use
HINT:  Check if there are any old server processes still running, and 
terminate them.


The others both looked like this:
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
LOG:  incomplete startup packet
LOG:  server process (PID 1384) was terminated by exception 0xC0000142
HINT:  See C include file "ntstatus.h" for a description of the 
hexadecimal value.
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back 
the current transaction and exit, because another server process exited 
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and 
repeat your command.
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back 
the current transaction and exit, because another server process exited 
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and 
repeat your command.
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back 
the current transaction and exit, because another server process exited 
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and 
repeat your command.
LOG:  all server processes terminated; reinitializing
FATAL:  pre-existing shared memory block is still in use
HINT:  Check if there are any old server processes still running, and 
terminate them.


The version is 8.4.2-1.  This is a fairly clean windows XP SP3 machine 
without any antivirus software.

The machine was running two separate postmasters using the same 
installation and they had both been chugging along for a while.  A third 
unrelated non-postgres job started that turned out to be a memory hog.  
The two "server processes" crashed within 5 minutes of one another, 
possibly at the very same time.  The autovacuum crash happened shortly 
thereafter on a brand new postmaster during startup.

We believe the machine was under memory pressure and that's what caused 
this problem (i.e., windows couldn't load the dlls because it didn't 
have memory).  It looks like postgres is already trying to do something 
not-completely-fatal, but fails to restart because of this "pre-existing 
shared memory block is still in use" error?  Any idea what's going on 
there?  I know sometimes windows takes a little extra time to 
acknowledge that a resource has been released, so it wouldn't surprise 
me if sleeping a little and trying again worked.  I know for a fact this 
approach is often necessary on the file system (if you call 
CreateFile/CloseHandle and DeleteFile in rapid succession on the same 
name, some failures can arise).

- Dave


Re: pre-existing shared memory block is still in use after crashes

От:
Alvaro Herrera <alvherre@alvh.no-ip.org>
Дата:
Excerpts from Dave Vitek's message of jue may 06 10:44:34 -0400 2010:
> Hi all,
> 
> Yesterday I ran into two backend crashes and then an autovacuum launcher 
> process crash.  The autovacuum log was:
> LOG:  database system is ready to accept connections
> LOG:  autovacuum launcher process (PID 3788) was terminated by exception 
> 0xC0000142
> HINT:  See C include file "ntstatus.h" for a description of the 
> hexadecimal value.

0xC0000142 is STATUS_DLL_INIT_FAILED

Apparently this can mean insufficient heap space.  I'm not sure if this is a
surprising thing to get during high load.

Not sure what can we do about it.

As for the failed restart, maybe the code that detects a conflicting shared
memory block could use a retry loop somewhere.
-- 

Re: pre-existing shared memory block is still in use after crashes

От:
Magnus Hagander <magnus@hagander.net>
Дата:
On Thu, May 6, 2010 at 17:42, Alvaro Herrera  wrote:
> Excerpts from Dave Vitek's message of jue may 06 10:44:34 -0400 2010:
>> Hi all,
>>
>> Yesterday I ran into two backend crashes and then an autovacuum launcher
>> process crash.  The autovacuum log was:
>> LOG:  database system is ready to accept connections
>> LOG:  autovacuum launcher process (PID 3788) was terminated by exception
>> 0xC0000142
>> HINT:  See C include file "ntstatus.h" for a description of the
>> hexadecimal value.
>
> 0xC0000142 is STATUS_DLL_INIT_FAILED
>
> Apparently this can mean insufficient heap space.  I'm not sure if this is a
> surprising thing to get during high load.
>
> Not sure what can we do about it.

Do you know how many processes were running at the time? (both pg
backend processes and processes in general)?



-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/
FAQ