FATAL: could not reattach to shared memory (Win32)

Lists: pgsql-general
From: Terry Yapt <yapt(at)technovell(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-23 10:20:17
Message-ID: 46CD5F61.7060005@technovell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hello all,

I am having problems with the next postgresql version:

pg version: 8.2.4
OS: Win32 (windows xp sp2)
FS: NTFS

It is a production server, but suddenly the DB stop answering to any sql
command. It seems dead. After restart server all starts to works again.

I am looking for system errors and nothing is there. But I have a lot
of messages on system APP errors. The error is the same every ten
seconds or so.

This is the main error:
* FATAL: could not reattach to shared memory (key=5432001,
addr=01D80000): Invalid argument

It is always followed by this another system-app error:
* LOG: unrecognized win32 error code: 487

I have found this on my intensive internet search:
http://archives.postgresql.org/pgsql-bugs/2007-01/msg00032.php

I need to solve this ASAP. Anybody have any idea about this ?

Thanks.


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Terry Yapt <yapt(at)technovell(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-23 14:30:35
Message-ID: 20070823143035.GP26038@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Terry Yapt wrote:

> I am looking for system errors and nothing is there. But I have a lot of
> messages on system APP errors. The error is the same every ten seconds or
> so.
>
> This is the main error:
> * FATAL: could not reattach to shared memory (key=5432001, addr=01D80000):
> Invalid argument

Please run "ipcs" on a command line window and paste the results.

I see a minor problem in that code: we are invoking two system calls
(shmget and shmat) but the log does not say which one failed. However
in this case it seems only shmget could be returning EINVAL.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Terry Yapt <yapt(at)technovell(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-23 19:53:22
Message-ID: 46CDE5B2.60002@technovell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Sorry, I have not be able to execute "ipcs" on windows. it doesn't
exists. I have tried to find some utility that gives me the same
information or any ipcs porting to win32, but I haven't had any luck.

If I can do something more to get help, please tell me.

Greetings.

Alvaro Herrera escribió:
> Terry Yapt wrote:
>
>
>> I am looking for system errors and nothing is there. But I have a lot of
>> messages on system APP errors. The error is the same every ten seconds or
>> so.
>>
>> This is the main error:
>> * FATAL: could not reattach to shared memory (key=5432001, addr=01D80000):
>> Invalid argument
>>
>
> Please run "ipcs" on a command line window and paste the results.
>
> I see a minor problem in that code: we are invoking two system calls
> (shmget and shmat) but the log does not say which one failed. However
> in this case it seems only shmget could be returning EINVAL.
>
>


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Terry Yapt <yapt(at)technovell(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-23 20:00:11
Message-ID: 20070823200011.GG31461@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Terry Yapt wrote:

> This is the main error:
> * FATAL: could not reattach to shared memory (key=5432001, addr=01D80000):
> Invalid argument
>
> It is always followed by this another system-app error:
> * LOG: unrecognized win32 error code: 487

FWIW,
http://help.netop.com/support/errorcodes/win32_error_codes.htm

says
487 Attempt to access invalid address. ERROR_INVALID_ADDRESS

This problem has been reported before, for example in

http://bbs.chinaunix.net/thread-973003-1-1.html
(not that I can read it very well)

and

http://lists.pgfoundry.org/pipermail/brasil-usuarios/20061127/003150.html

No resolution seems to have been found.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Terry Yapt <yapt(at)technovell(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-23 20:29:03
Message-ID: 46CDEE0F.7060507@technovell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Alvaro Herrera escribió:
> Terry Yapt wrote:
>
>
>> This is the main error:
>> * FATAL: could not reattach to shared memory (key=5432001, addr=01D80000):
>> Invalid argument
>>
>> It is always followed by this another system-app error:
>> * LOG: unrecognized win32 error code: 487
>>
>
> This problem has been reported before, for example in
>
> http://bbs.chinaunix.net/thread-973003-1-1.html
> (not that I can read it very well)
>
> and
>
> http://lists.pgfoundry.org/pipermail/brasil-usuarios/20061127/003150.html
>
>
Yes, those are the same than here:
http://archives.postgresql.org/pgsql-bugs/2007-01/msg00032.php

> No resolution seems to have been found.
>
Then, I am very worried now. :-|

Thanks Alvaro.


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Terry Yapt <yapt(at)technovell(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-23 20:43:32
Message-ID: 46CDF174.1090407@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Alvaro Herrera wrote:
> Terry Yapt wrote:
>
>> This is the main error:
>> * FATAL: could not reattach to shared memory (key=5432001, addr=01D80000):
>> Invalid argument
>>
>> It is always followed by this another system-app error:
>> * LOG: unrecognized win32 error code: 487
>
> FWIW,
> http://help.netop.com/support/errorcodes/win32_error_codes.htm
>
> says
> 487 Attempt to access invalid address. ERROR_INVALID_ADDRESS
>
> This problem has been reported before, for example in
>
> http://bbs.chinaunix.net/thread-973003-1-1.html
> (not that I can read it very well)
>
> and
>
> http://lists.pgfoundry.org/pipermail/brasil-usuarios/20061127/003150.html
>
> No resolution seems to have been found.

8.3 will have a new way to deal with shared mem on win32. It's the same
underlying tech, but we're no longer trying to squeeze it into an
emulation of sysv. With a bit of luck, that'll help :-)

//Magnus


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Terry Yapt <yapt(at)technovell(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-23 20:52:26
Message-ID: 20070823205226.GH31461@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Magnus Hagander wrote:
> Alvaro Herrera wrote:

> > No resolution seems to have been found.
>
> 8.3 will have a new way to deal with shared mem on win32. It's the same
> underlying tech, but we're no longer trying to squeeze it into an
> emulation of sysv. With a bit of luck, that'll help :-)

So you're saying we won't fix this bug in 8.2? That seems unfortunate,
given that 8.2 is still supposed to be supported on Windows.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Terry Yapt <yapt(at)technovell(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-24 03:27:05
Message-ID: 17034.1187926025@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Magnus Hagander wrote:
>> 8.3 will have a new way to deal with shared mem on win32. It's the same
>> underlying tech, but we're no longer trying to squeeze it into an
>> emulation of sysv. With a bit of luck, that'll help :-)

> So you're saying we won't fix this bug in 8.2?

Well, we certainly aren't going to back-patch a major rewrite that
(1) hasn't made it through beta testing, and (2) is not actually known
to fix the bug. When and if those gating conditions stop being true,
maybe we could consider a back-patch.

But at the moment this is all speculation ... I counsel concentrating
on finding out what's really happening on Terry's machine, before trying
to guess whether we already have a fix written.

regards, tom lane