Thread: Cygwin on Win98: initdb failed

Cygwin on Win98: initdb failed

From
Christian Rank
Date:
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.2222 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?

Thanks in advance,
    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


Re: Cygwin on Win98: initdb failed

From
"Mike G."
Date:
Hi,

 Postgres hasn't worked on Win98 since Cygwin switched to cygserver for memory management instead of ipc_daemon.  I
believe7.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.2222 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?
> >
> > Thanks in advance,
> >     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
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: Cygwin on Win98: initdb failed

From
Christian Rank
Date:
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
believe7.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.2222 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