| From: | Dave Vitek <dvitek(at)grammatech(dot)com> | 
|---|---|
| To: | pgsql-general(at)postgresql(dot)org | 
| Subject: | pre-existing shared memory block is still in use after crashes | 
| Date: | 2010-05-06 14:44:34 | 
| Message-ID: | 4BE2D5D2.6040400@grammatech.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nicholas I | 2010-05-06 14:48:26 | Need a help in regexp | 
| Previous Message | Tom Lane | 2010-05-06 14:13:44 | Re: Please help me debug regular segfaults on 8.3.10 |