pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Petros Tsialiamanis <tsialiam@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6735: PANIC: 42501: could not open control file "global/pg_control": Permission denied
Date: Sat, 14 Jul 2012 12:56:50 +0800
Message-ID: <5000FC12.90300@ringerc.id.au> (raw)
In-Reply-To: <CAHauTQqPOhyRJwRF8hmvT8jtM=GfHeWtMXeucmfQ-3uvReR3BA@mail.gmail.com>
References: <E1SpfTr-0004sc-RC@wrigleys.postgresql.org>
	<50003BAB.8050505@ringerc.id.au>
	<CAHauTQqPOhyRJwRF8hmvT8jtM=GfHeWtMXeucmfQ-3uvReR3BA@mail.gmail.com>

On 07/14/2012 12:18 AM, Petros Tsialiamanis wrote:
> Thank you very much for your reply.
Thanks for coming back and re-testing with a modern PostgreSQL.

PostgreSQL 9.1 isn't compatible with databases from 8.3, so you can't 
actually run Pg 9.1 directly against a datadir from 8.3; that's why I 
suggested the latest 8.3 point release.

However, your startup should be failing with a message telling you this, 
not with a permissions error then (more importantly) a crash.

Is there any antivirus software on this computer? If so, what is it? 
Does excluding the PostgreSQL data directory, PostgreSQL executable 
directory, and (if the AV supports it) adding process exclusions for 
"postmaster.exe" and "postgres.exe" have any effect?
> The 'pss-svc' user is member of the administrators group and has full
> permissions for PostgreSQL data directory.
It clearly doesn't, because PostgreSQL is getting "permission denied" 
from the OS when accessing global/pg_control. Maybe you need to apply 
permissions recursively?

Remember that on Win7, membership of the Administrators group doesn't 
grant the ability to perform file operations as administrator directly. 
It grants the ability to create privileged processes that can then 
perform those operations using implicit or explicit "run as 
administrator" functionality.

I can't off the top of my head think of a safe way on Windows to test if 
a file is writable as a given user without potentially changing its 
contents. On Linux I'd say "run touch /path/name" but there's no touch 
command on Windows. global\pg_control is a binary file so you can't just 
open it and save it in notepad (DO NOT DO THIS) as it'll corrupt it 
hopelessly, and Windows doesn't come with a binary-safe editor.
> I reproduced the crash with PostgreSQL version 9.1.4.12152 with the
> following output :
[snip]
> LOCATION:  _dosmaperr, .\src\port\win32error.c:186
> PANIC:  42501: could not open control file "global/pg_control":
> Permission denied
> LOCATION:  ReadControlFile, .\src\backend\access\transam\xlog.c:4687
>
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ******************************************************************

OK, that's not very nice behaviour - it should be doing a clean exit 
after it fails to read global/pg_control . Hmm. I'm not sure off the top 
of my head how to tackle tracking that down without a debugger. I don't 
really have time at the moment to set up a test environment under 
Windows and see if I can reproduce it.

Ideas anyone? Can someone with a Windows box use pg_ctl to try to start 
a new Pg instance against a datadir with an unwritable pg_control ?

--
Craig Ringer



view thread (7+ messages)  latest in thread

Message-ID: <5000FC12.90300@ringerc.id.au>
Permalink:  ../5000FC12.90300@ringerc.id.au/
Also on:    postgresql.org/message-id/5000FC12.90300@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: ringerc@ringerc.id.au, tsialiam@gmail.com
  Subject: Re: BUG #6735: PANIC: 42501: could not open control file "global/pg_control": Permission denied
  In-Reply-To: <5000FC12.90300@ringerc.id.au>
  References: <E1SpfTr-0004sc-RC@wrigleys.postgresql.org> <50003BAB.8050505@ringerc.id.au> <CAHauTQqPOhyRJwRF8hmvT8jtM=GfHeWtMXeucmfQ-3uvReR3BA@mail.gmail.com> <5000FC12.90300@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox