[PATCH] Large processes shared.cc fix

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Fri Dec 31 18:41:00 GMT 2004


On Fri, Dec 31, 2004 at 03:58:20PM +0200, Eizenberg Ariel wrote:
>Hi,
>
>This patch fixes a problem I have with running large fortran programs
>(actually most programs with a very large image size in memory). The
>problem occurs on Windows 2000, XP and 2003.
>
>The problem occurs when a process is large enough so when open_shared()
>tries to map the shared memory section to 0x0A000000, it fails, since
>0x0A000000 is occupied by the program. Since the
>MapViewOfFileEx(h,...,NULL) is preformed on a region smaller than the full
>region required for offsets[SH_TOTAL_SIZE], MapViewOfFileEx might allocate
>a region at a location which does not have enough free space after it,
>so the VirtualAlloc's at the end of open_shared() silently fail
>(in my case MapViewOfFileEx() returns 0x3d0000).

So, why is this a problem?  Why doesn't the "if (!shared)" immediately after
the first MapViewOfFileEx just avoid allocating the other non SH_CYGWIN_SHARED
shared memory regions at a fixed location?  That is what that code is there
to handle.

cgf



More information about the Cygwin-patches mailing list