Re: FATAL: could not reattach to shared memory (Win32) - Mailing list pgsql-general

From Shelby Cain
Subject Re: FATAL: could not reattach to shared memory (Win32)
Date
Msg-id 47682.67329.qm@web55414.mail.re4.yahoo.com
Whole thread Raw
In response to FATAL: could not reattach to shared memory (Win32)  (Terry Yapt <yapt@technovell.com>)
Responses Re: FATAL: could not reattach to shared memory (Win32)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I apologize for resending this but my editor in combination with Yahoo's web mail interface horribly mangled it...

>----- Original Message ----
>From: Magnus Hagander <magnus@hagander.net>
>To: Shelby Cain <alyandon@yahoo.com>
>Cc: Alvaro Herrera <alvherre@commandprompt.com>; Terry Yapt <yapt@technovell.com>; pgsql-general@postgresql.org
>Sent: Friday, August 24, 2007 1:08:44 AM
>Subject: Re: [GENERAL] FATAL: could not reattach to shared memory (Win32)
>
>Not that wild a guess, really :-) I'd say it's a very good possibility -
>but I have no idea why it'd do that, since all backends load the same
>DLLs at that stage.
>
>//Magnus
>

Assuming this is an issue with shared libraries, I think it would have more to do with the way Windows resolves address
conflictson process startup than anything caused by explicit calls to LoadLibrary().  Looking at postgres.exe with the
dependencyviewer from Visual Studio 6, I see that the following shared library dependencies embedded in the executable
imagethat having conflicting base addresses.  If I'm not mistaken, Windows will automatically relocate these libraries
priorto actual code execution so there would be no opportunity for that particular instance of postgres.exe to map the
sharedmemory if the address space is already in use by a relocated dll. 

libeay32.dll - 0x10000000
libiconv-2.dll - 0x10000000
libintl-2.dll - 0x10000000
ssleay32.dll - 0x10000000
comerr32.dll - 0x1c000000
krb5_32.dll - 0x1c000000

I also found a KB article that addresses ERROR_INVALID_MEMORY being returned from MapViewOfFileEx().

http://support.microsoft.com/kb/125713

The article specifically addresses the concern where multiple processes must use the same address for mappings and how
toaccomplish that under Windows.  Search for "Addresses of Mapped Views".  The only thing that really gives me any
pauseis the fact the article hasn't been updated past the NT 3.51/Windows 9x era but the underlying behavior might not
havebeen changed in Windows 2000/XP/etc. 

Regards,

Shelby Cain







____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow

pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: Out of Memory - 8.2.4
Next
From: Tom Lane
Date:
Subject: Re: FATAL: could not reattach to shared memory (Win32)