delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/21/10:41:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 21 Sep 2004 16:42:25 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin on Win98: initdb failed
Message-ID: <20040921144225.GQ17670@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <414E7BEA DOT 3020704 AT rz DOT uni-passau DOT de> <20040921042320 DOT GA22752 AT localhost DOT localdomain> <20040921043959 DOT GA22835 AT localhost DOT localdomain> <41502669 DOT 60308 AT rz DOT uni-passau DOT de>
Mime-Version: 1.0
In-Reply-To: <41502669.60308@rz.uni-passau.de>
User-Agent: Mutt/1.4.2i

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:
> 	http://cygwin.com/ml/cygwin/2004-08/msg00277.html
> 
> 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/sysv_shm.cc,
> line 385: shmaddr: 82FFD000, shmflg: 0
> cygserver: /netrel/src/cygwin-1.5.11-1/winsup/cygserver/sysv_shm.cc,
> 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 (http://cygwin.com/snapshots.html) a try.


Thanks for the analysis,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019