Re: Crazy W2000 service behavior

From: "Gary Doades" <gpd(at)gpdnet(dot)co(dot)uk>
To: "pgsql win32 hack" <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: Crazy W2000 service behavior
Date: 2004-07-20 06:52:02
Message-ID: 40FCCF22.24132.1C2EB7DE@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

On 20 Jul 2004 at 7:57, Stasys Adiklis wrote:

>
> All the paths are OK (system ones). Let's try autostartup:
>
> 1. [pg_ctl unregister, ]pg_ctl register -U pgsql -P password. Service
> startup type: Automatic.
> 2. reboot
> 3. service is not running. Event Viewer (Source: Service Control Manager):
> Description: The PostgreSQL service hung on starting.
> Description: The PostgreSQL service terminated unexpectedly. It has done
> this 1 time(s). The following corrective action will be taken in 0
> milliseconds: No action.
>
> A bit later i did: runas /user:pgsql cmd, pg_ctl start and it worked.
> Stopped it with Ctrl+Break (i know i should have pg_ctl stop, but...). A bit
> later i tried to launch it again with runas /user:pgsql "pg_ctl start" and
> got that "failure to initialize" error pop-up. Event Viewer (Source:
> Application Popup):
> Description: Application popup: postmaster.exe - Application Error : The
> application failed to initialize properly (0xc0000142). Click on OK to
> terminate the application.
>

Ah now that you have said 0xc0000142 (not 0x0000142) it makes a little
more sense. Searching MSDN these errors relate to loading of DLLs. Either
the wrong version, or trying to use a DLL before it is initialised.

If it were a versioning problem with a system DLL I think it would never
work. So we are left with an intermittent timing/synchronisation problem.
Weirdly it only *seems* to happen under Win2K.

I don't know enough about the startup sequence of postgres to go further at
this stage, but I would guess that postmaster or one of the postgres
processes is not waiting enough or syncing properly before attempting DLL
calls. This might also explain why it works the second time when stuff
(including the DLLs) are more likely to be in memory and start up faster.

Debugging timing/sync problems can be tricky (if this is indeed the
problem). The guys that know lots more than me will have to look at this
one.

Cheers,
Gary.

In response to

Responses

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Christian Klemke 2004-07-20 07:46:44 Re: Crazy W2000 service behavior
Previous Message Stasys Adiklis 2004-07-20 04:57:53 Re: Crazy W2000 service behavior