Re: Cygwin on Win98: initdb failed

2004-09-22 Thread Christian Rank
On Sep 21 16:42, Corinna Vinschen wrote:

 On Sep 21 15:02, Christian Rank wrote:
 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.

OK, I will test it with the next snapshot (not online yet).
Thank you very much for fixing this so quickly.

Best regards,
Christian

-- 
Dr. Christian Rank
Rechenzentrum Universität Passau
Innstr. 33
D-94032 Passau
GERMANY
Tel.: 0851/509-1838
Fax:  0851/509-1802
PGP public key see http://www.rz.uni-passau.de/mitarbeiter/rank



--
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/



Re: Cygwin on Win98: initdb failed

2004-09-21 Thread Christian Rank
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

This should be an indication that the problem is the cygserver program
(it generates an invalid address) and not the PostgreSQL software.

I've also tested with the latest cygwin snapshot of 2004-Sep-20, but the
issue persists.

Perhaps the cygserver maintainers can use the information above to
further investigate the problem. I would be happy to provide more input
if needed.

Regards,
Christian

  Hi,
  
  Postgres hasn't worked on Win98 since Cygwin switched to cygserver for memory 
 management instead of ipc_daemon.  I believe 7.4.3 was the version to require 
 cygserver to run.
  
  Mike
 
On Mon, Sep 20, 2004 at 08:42:50AM +0200, Christian Rank wrote:

Hello,

I'm trying to run the Cygwin version of PostgreSQL on Windows 98 SE.
During initdb, creation of the initial database cluster is aborted with
the message
creating template1 database in /var/pgsql/data/base/1...
 shmat(id=1179648) failed: invalid argument

The sequence of commands leading to this is as follows:

  mkdir /var/pgsql
  export CYGWIN=server
  /usr/bin/cygserver-config -n
  /usr/sbin/cygserver -E 
  mkdir /var/pgsql/data
  initdb -D /var/pgsql/data -E LATIN1

Software versions used:
  cygwin 1.5.11-1
  PostgreSQL 7.4.5-1
  Windows 98 Second Edition 4.10. A

The same setup runs on Windows 2000 without problems. According to the
cygserver docs, it should run on Win98, too.

Does anybody know what's going wrong here?

-- 
Dr. Christian Rank
Rechenzentrum Universität Passau
Innstr. 33
D-94032 Passau
GERMANY
Tel.: 0851/509-1838
Fax:  0851/509-1802
PGP public key see http://www.rz.uni-passau.de/mitarbeiter/rank


--
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/



Re: Cygwin on Win98: initdb failed

2004-09-21 Thread Corinna Vinschen
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:[EMAIL PROTECTED]
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/