Skip site navigation (1) Skip section navigation (2)

BUG #6201: Windows User Log Off Causes Backend Exception 0xC0000142

From: "Jerome Schulteis" <jerome(dot)schulteis(at)edstrom(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6201: Windows User Log Off Causes Backend Exception 0xC0000142
Date: 2011-09-09 20:59:50
Message-ID: (view raw or whole thread)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      6201
Logged by:          Jerome Schulteis
Email address:      jerome(dot)schulteis(at)edstrom(dot)com
PostgreSQL version: 9.0.4
Operating system:   Windows XP Pro SP3
Description:        Windows User Log Off Causes Backend Exception 0xC0000142

It does not happen on every log off, but if the Windows console user logs
of the server at just the wrong time while a backend is starting up, the
backend terminates with exception 0xC0000142 (STATUS_DLL_INIT_FAILED), and
PostgreSQL Windows service stops (shared memory block is still in use):

2011-09-09 10:34:01 CDT LOG:  server process (PID 3260) was terminated by
exception 0xC0000142
2011-09-09 10:34:01 CDT HINT:  See C include file "ntstatus.h" for a
description of the hexadecimal value.
2011-09-09 10:34:01 CDT LOG:  terminating any other active server processes
2011-09-09 10:34:02 CDT WARNING:  terminating connection because of crash of
another server process
2011-09-09 10:34:02 CDT 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.
2011-09-09 10:34:02 CDT HINT:  In a moment you should be able to reconnect
to the database and repeat your command.
2011-09-09 10:34:02 CDT LOG:  all server processes terminated;
2011-09-09 10:34:12 CDT FATAL:  pre-existing shared memory block is still in
2011-09-09 10:34:12 CDT HINT:  Check if there are any old server processes
still running, and terminate them.

Originally encountered with our web app running a stress test on PostgreSQL
8.4.2; I reproduced it on a default one-click install of 9.0.4.  I run the
following Java on a separate machine to get a new connection every 100 ms:

class ConnectionHog {
    static public void main(String[] args) {
        try {
            while (true) {
                java.sql.DriverManager.getConnection(args[0], args[1],
        catch (Throwable t) {

I then log on and off the server from a separate user account (that is, not
the postgres
account); the error shows up after at most 3 log offs. As long as no log
offs happen on the server, no problem.


pgsql-bugs by date

Next:From: Craig RingerDate: 2011-09-10 00:53:13
Subject: Re: BUG #6201: Windows User Log Off Causes Backend Exception 0xC0000142
Previous:From: Simon RiggsDate: 2011-09-09 15:14:38
Subject: Re: BUG #6200: standby bad memory allocations on SELECT

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group