This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin on Win98: initdb failed

On Sep 21 15:02, Christian Rank wrote:
> Hi,
> thanks to all who replied to my question. It seems that so far there is
> no solution:
> I've done some debugging and found out that the shmat... error message
> is generated by PostgreSQL in the source module
> src/backend/port/sysv_shmem.c during execution of the following code:
>         /* OK, should be able to attach to the segment */
> #ifdef SHM_SHARE_MMU
>         /* use intimate shared memory on Solaris */
>         memAddress = shmat(shmid, 0, SHM_SHARE_MMU);
> #else
>         memAddress = shmat(shmid, 0, 0);
> #endif
>         if (memAddress == (void *) -1)
>                 elog(FATAL, "shmat(id=%d) failed: %m", shmid);
> Here it can be seen that shmat is called with a shmaddr (second
> parameter) of 0, which means "the system should itself choose a suitable
> address". (Thus there is no need for supplying the SHM_RND flag.)
> The corresponding debugging info of cygserver reads:
> cygserver: /netrel/src/cygwin-1.5.11-1/winsup/cygserver/,
> line 385: shmaddr: 82FFD000, shmflg: 0
> cygserver: /netrel/src/cygwin-1.5.11-1/winsup/cygserver/,
> line 393: Odd shmaddr: EINVAL

Urgh!  Ok, well... looking into the implementation of shmat, there's
only one explanation for this behaviour.  Apparently MapViewOfFileEx
returned memory which isn't aligned to the memory granulation.

[time passes, testing on a 9x system]

That's it.  Incredible.  I've checked in a patch to cygserver which
takes this into account.  Please give cygserver from the next Cygwin
snapshot ( a try.

Thanks for the analysis,

Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader
Red Hat, Inc.

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]