Various bugs with PG7.1 8th March snapshot on Solaris 8 INTEL - Mailing list pgsql-bugs

From Justin Clift
Subject Various bugs with PG7.1 8th March snapshot on Solaris 8 INTEL
Date
Msg-id 3AAE04AF.CAACD13F@iprimus.com.au
Whole thread Raw
Responses Re: Various bugs with PG7.1 8th March snapshot on Solaris 8 INTEL  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
Hi all,

Sorry for sending this directly as an email.  The Bug Form on the
PostgreSQL webpage keeps on timing out on me.  (Server overload?)

These are five errors/bugs and solutions from the 8th March 2001
PostgreSQL 7.1 snapshot.

The system :

Solaris 8 INTEL (10/00 release as available for download from Sun)
Maintenance Update 3 installed, recommended patches installed.
128 MB RAM
2 x 400 Mhz CPU's
GCC 2.95.2
GNU Make 3.79.1
GNU Flex 2.5.4
GNU Bison 1.28
OpenSSL 0.9.6 installed
Didn't have readline installed
General other GNU utils installed, nothing weird.

This system is known to be stable and doesn't generally have compilation
problems.

Compilation command :

./configure --p=/opt/postgresql71 --enable-syslog
--with-openssl=/opt/openssl

*** 1 ***

Firstly there is a complation error :

When --with-openssl=<the path to my openssl dir> is given to configure
on Solaris 8 INTEL, the compilation errors in :

 - src/backend/libpg/crypt.c (line 26)
 - src/backend/libpg/password.c (line 14)
 - src/interfaces/libpq/fe-auth.c (line 49)
 - src/interfaces/libpq/fe-connect.c (line 43)

because of :

#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif

Seems to be causing a conflict with the built in /usr/include/crypt.h
and the <openssl dir>/include/openssl/des.h

The error given by the compilation process is (this one's for
fe-connect.c):

make[3]: Entering directory
`/install/new2/postgresql-snapshot/src/interfaces/libpq'
gcc  -Wall -Wmissing-prototypes -Wmissing-declarations -fPIC -I.
-I../../../src/include -I/opt/openssl/include -DFRONTEND
-DSYSCONFDIR='"/opt/postgresql71/etc"'  -c -o fe-connect.o fe-connect.c
In file included from fe-connect.c:44:
/usr/include/crypt.h:23: conflicting types for `des_encrypt'
/opt/openssl/include/openssl/des.h:150: previous declaration of
`des_encrypt'
make[3]: *** [fe-connect.o] Error 1
make[3]: Leaving directory
`/install/new2/postgresql-snapshot/src/interfaces/libpq'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/install/new2/postgresql-snapshot/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/install/new2/postgresql-snapshot/src'
make: *** [all] Error 2

I fixed this by just commenting out the #ifdef section and it's included
<crypt.h> in each of these 4 files.  Compiles fine after this.

*** 2 ***

Next problem is that running 'gmake check' expects to find the new
'postgres' file in the normal PATH, not in the temporary installation
PATH.  I deduce this from the ./src/test/regress/log/initdb.log file
which complains about not being able to find the 'postgres' file in the
installation location.

Here's the relevant error from 'gmake check' :

<snip>
============== creating temporary installation        ==============
============== initializing database system           ==============

pg_regress: initdb failed
Examine ./log/initdb.log for the reason.

make[2]: *** [check] Error 2
rm regress.o
make[2]: Leaving directory
`/install/new2/postgresql-snapshot/src/test/regress'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/install/new2/postgresql-snapshot/src/test'
make: *** [check] Error 2
bash-2.03$ echo $PATH

/usr/local/bin:/usr/bin:/usr/openwin/bin:/usr/ccs/bin:/opt/postgresql71/bin:/usr/dt/bin:/usr/local/qt/bin:/usr/games:/opt/kde/bin
bash-2.03$ more src/test/regress/log/initdb.log
The program 'postgres' is needed by initdb but was not found in
the directory '/opt/postgresql71/bin'.  Check your installation.
bash-2.03$ find . -name "postgres" -type f
./src/backend/postgres
./src/test/regress/tmp_check/install/opt/postgresql71/bin/postgres
bash-2.03$

*** 3 ***

A third problem and solution is this misleading error message :

Even after doing a 'make install' to ensure the above make check will
find the files it's after, I get this :

bash-2.03$ make install
<snipped installation stuff>
bash-2.03$ make check
<snipped general make check stuff>

============== removing existing temp installation    ==============
============== creating temporary installation        ==============
============== initializing database system           ==============

pg_regress: initdb failed
Examine ./log/initdb.log for the reason.

make[2]: *** [check] Error 2
make[2]: Leaving directory
`/install/new2/postgresql-snapshot/src/test/regress'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/install/new2/postgresql-snapshot/src/test'
make: *** [check] Error 2
bash-2.03$ more src/test/regress/log/initdb.log
The program '/opt/postgresql71/bin/postgres' needed by initdb does not
belong to PostgreSQL version 7.1beta5.  Check your installation.
bash-2.03$

This sounded like I had a bad PATH, or existing PostgreSQL files in
LD_LIBRARY_PATH or something.

After investigating a bit futher, the reason for the error message was
really that I didn't have the path to the openssl library files in
LD_LIBRARY_PATH :

$ initdb
The program '/opt/postgresql71/bin/postgres' needed by initdb does not
belong to PostgreSQL version 7.1beta5.  Check your installation.

$ cd /opt/postgresql71/bin
$ ./postgres -version
ld.so.1: ./postgres: fatal: libssl.so.0: open failed: No such file or
directory
Killed
$ echo $LD_LIBRARY_PATH
/opt/postgresql71/lib
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openssl/lib
$ export LD_LIBRARY_PATH
$ ./postgres -version
FATAL 1:  Can't create lock file /opt/postgresql71/data/postmaster.pid:
No such file or directory
$ initdb
This database system will be initialized with username "postgres".
This user will own all the data files and must also own the server
process.

Creating directory /opt/postgresql71/data
Creating directory /opt/postgresql71/data/base
Creating directory /opt/postgresql71/data/global
Creating directory /opt/postgresql71/data/pg_xlog
Creating template1 database in /opt/postgresql71/data/base/1
DEBUG:  starting up
DEBUG:  database system was shut down at 2001-03-12 18:08:15
DEBUG:  CheckPoint record at (0, 8)
DEBUG:  Redo record at (0, 8); Undo record at (0, 8); Shutdown TRUE
DEBUG:  NextTransactionId: 514; NextOid: 16384
DEBUG:  database system is in production state
Creating global relations in /opt/postgresql71/data/global
DEBUG:  starting up
DEBUG:  database system was shut down at 2001-03-12 18:08:18
DEBUG:  CheckPoint record at (0, 112)
DEBUG:  Redo record at (0, 112); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 514; NextOid: 17199
DEBUG:  database system is in production state
Initializing pg_shadow.
Enabling unlimited row width for system tables.
Creating system views.
Loading pg_description.
Setting lastsysoid.
Vacuuming database.
Copying template1 to template0.

Success. You can now start the database server using:

        /opt/postgresql71/bin/postmaster -D /opt/postgresql71/data
or
        /opt/postgresql71/bin/pg_ctl -D /opt/postgresql71/data start

$

So.. suddenly it works.  After finding this out, I set the
LD_LIBRARY_PATH to include the openssl libraries and did another make
check in the src/test/regress directory and this time it worked.

So, I don't know how you would do it, but I believe the error message
about the version of 'postgres' not belonging to 7.1beta5 to be really
misleading, as what it should be complaining about is not being able to
find the openssl libraries.

*** 4 ***

In the regression test side of things, Solaris 8 INTEL seems be having
troubles with handling int8 types.  Not sure if this is a known
problem.  The int8 tests failed with error messages like :

  INSERT INTO INT8_TBL VALUES('123','4567890123456789');
+ ERROR:  int8 value out of range: "4567890123456789"

Naturally, the rest of the int8 tests didn't complete nicely as the data
wasn't there to test with.  The subselect and union tests also failed in
the parts that were to do with int8, due to these large numbers it
doesn't seem to be able to handle.

*** 5 ***

'Make clean' doesn't work :

$ make clean
make -C doc clean
make[1]: Entering directory `/install/new2/postgresql-snapshot/doc'
make[1]: Nothing to be done for `clean'.
make[1]: Leaving directory `/install/new2/postgresql-snapshot/doc'
make -C contrib clean
make[1]: Entering directory `/install/new2/postgresql-snapshot/contrib'
for dir in array cube earthdistance findoidjoins fulltextindex intarray
isbn_issn lo mSQL-interface mac miscutil noupdate oid2name pg_dumplo
pg_logger pgbench pgcrypto rserv seg soundex spi string tips unixdate
userlock vacuumlo    ; do \
    if [ -e $dir/Makefile ]; then \
        make -C $dir clean; \
    fi; \
done
/bin/sh: test: argument expected
make[1]: *** [clean] Error 1
make[1]: Leaving directory `/install/new2/postgresql-snapshot/contrib'
make: *** [clean] Error 2
$

At this stage, I was tired and grumpy and Couldn't Be Bothered checking
which Makefile had the error in it.  :-/

Regards and best wishes,

Justin Clift

pgsql-bugs by date:

Previous
From: Marcin Wolinski
Date:
Subject: Re: 7.0.x not using indices
Next
From: Alexander Klimov
Date:
Subject: plperl with 5.7.0