Bug #3825 Problem with library Search on make test wit mysql-4.0.20
Submitted: 19 May 2004 2:36 Modified: 5 Jun 2004 17:22
Reporter: Boyd GERBER Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:mysql-4.0.20 OS:UnixWare 7.1.3
Assigned to: CPU Architecture:Any

[19 May 2004 2:36] Boyd GERBER
Description:
The "make test" fails with the following.

$ make test
cd mysql-test ; ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/master-data --skip-innodb --skip-bdb --skip-warnings --language=../sql/share/english/
040519  2:35:27  ../sql/mysqld: Shutdown Complete

Installing Slave Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/slave-data --skip-innodb --skip-bdb --skip-warnings --language=../sql/share/english/
040519  2:35:27  ../sql/mysqld: Shutdown Complete

Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

 TEST                           RESULT
------------------------------------------
alias                          [ fail ]

Errors are (from /home/mount/uw713/zenez1/build/uw713/mysql-4.0.20/mysql-test/var/log/mysqltest-time) :dynamic linker: /home/mount/uw713/zenez1/build/uw713/mysql-4.0.20/client/.libs/mysqltest: relocation error: symbol not found: __llasgdivu; referenced from: /usr/local/mysql/lib/mysql/libmysqlclient.so.12

(the last line(s) may be the ones that caused the die() in mysqltest)

Aborting. To continue, re-run with '--force'.

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
make: *** [test] Error 1

How to repeat:
I build this mysql-4.0.20 with

CC="cc" CFLAGS="-I/usr/local/include" CXX="CC" CFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local/mysql --enable-thread-safe-client --with-berkeley-db=./bdb --with-innodb --with-openssl --with-extra-charsets=complex

Which is what I have been testing the bk with.  The last bk I tried was last Friday with a pull thursday.  Most tests passed.

I have tried the following.

PATH=/usr/bin:/bin:/usr/ccs/bin:/home/gerberb/bin:.:usr/gnu/bin:/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/ccs/bin:/usr/local/ubin:/usr/zenez/bin:/etc:
LIBPATH=/usr/lib:/lib:/usr/gnu/lib:/usr/local/lib:/usr/ccs/lib:
LD_LIBRARY_PATH=;/usr/lib:/lib:/usr/local/lib:/usr/local/mysql/lib/mysql:/usr/l
ocal/bdb/lib:/usr/local/ssl/lib:
or
LD_LIBRARY_PATH=/usr/lib:/lib:/usr/gnu/lib:/usr/local/lib:/usr/ccs/lib:/usr/local/mysql/lib/mysql:/usr/local/bdb/lib:/usr/lib/ssl/openssl/lib:
or
LD_LIBRARY_PATH=.:/usr/lib:/lib:/usr/gnu/lib:/usr/local/lib:/usr/ccs/lib:/usr/local/mysql/lib/mysql:/usr/local/bdb/lib:/usr/lib/ssl/openssl/lib:
and
LD_LIBRARY_PATH=/home/mount/uw713/zenez1/build/uw713/mysql-4.0.20/libmysql_r/.libs:/home/mount/uw713/zenez1/build/uw713/mysql-4.0.20/libmysql/.libs/:/usr/lib:/lib:/usr/gnu/lib:/usr/local/lib:/usr/ccs/lib:/usr/local/mysql/lib/mysql:/usr/local/bdb/lib:/usr/lib/ssl/openssl/lib:

After changinge LD_LIBRARY_PATH with each of the above I redid a configure (using the above), make and make test all giving me the following error.

$(configure from above)
$ make
$ make test
cd mysql-test ; ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/master-data --skip-innodb --skip-bdb --skip-warnings --language=../sql/share/english/
040519  2:35:27  ../sql/mysqld: Shutdown Complete

Installing Slave Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/slave-data --skip-innodb --skip-bdb --skip-warnings --language=../sql/share/english/
040519  2:35:27  ../sql/mysqld: Shutdown Complete

Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

 TEST                           RESULT
------------------------------------------
alias                          [ fail ]

Errors are (from /home/mount/uw713/zenez1/build/uw713/mysql-4.0.20/mysql-test/var/log/mysqltest-time) :dynamic linker: /home/mount/uw713/zenez1/build/uw713/mysql-4.0.20/client/.libs/mysqltest: relocation error: symbol not found: __llasgdivu; referenced from: /usr/local/mysql/lib/mysql/libmysqlclient.so.12

(the last line(s) may be the ones that caused the die() in mysqltest)

Aborting. To continue, re-run with '--force'.

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
make: *** [test] Error 1

In the past all I had to do was use the first one...
LD_LIBRARY_PATH=\;/usr/lib:/lib:/usr/local/lib:/usr/local/mysql/lib/mysql:/usr/local/bdb/lib:/usr/local/ssl/lib:

but the second one also works.  These all seem to work on OpenServer 5.0.7 with the exact same LD_LIBRARY_PATH using the either of the first two.

This is the first time this has failed and I have never seen the make test use the /usr/local/mysql/lib/mysql/libmysqlclient.so.12 before.

Suggested fix:
I have to do a mkae install first then the tests work.  I should not have to do a make install untill I am sure that the new build of mysql works.  I have not investigated what has changed with mysql-4.0.18 to mysql-4.0.20 or the bk from last thrusday that worked properly.
[19 May 2004 2:58] Boyd GERBER
After a make install 9 tests are skipped which is normal and the following is printed to the screen.

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
All 209 tests were successful.
[29 May 2004 16:36] MySQL Verification Team
Boyd,

Thank you for writting to us.

Can you please find in which system library is that symbol found ??

As you know we do not have access to UnixWare OS.

Please see why is that shared library not linked in our program. 

If you have used GCC, this is possible a symbol from libgcc. 

See if putting that library in LD_LIBRARY_PATH would solve a problem.

Many thanks in advance.
[30 May 2004 5:10] Boyd GERBER
The symbol is found in libC.so, libC.so.1 and libc.so.1.  The same problem exists on OpenUNIX 8.0 and it is in the latest patches to LibC.so and libc.so.1  

The existing and the new version of mysql bpth were compiled with these same versions of the libraries.  What does not make sense is if I go back and use mysql-4.0.12-17 the problem does not exist.  This only happens with mysql-4.0.18, mysql-4.0.19 and mysql-4.0.20.  For some reason only these versions have this problem I have tried over 20 varriations of LD_LIBRARY_PATH and these versions of mysql insist on using libmysqlclient from /usr/local/mysq/lib/mysql instead of the one found earlier in the LD_LIBRARY_PATH.  

As I said it does not mater how the LD_LIBRARY_PATH is done.  The same problem is with either the native compiler or gcc.  The exact same problem occuses.  I have tests this with 7 older versions of mysql with out a problem just the .18, .19 and .20 versions have the problems  The symbol is in the libraries noted above.   As long as I do an install then the tests all pass.  It does not mater which version is in /usr/local/mysql/lib/mysql.  I build and tested these all from the exact same version of libC and libc.  I have .20 installed in /usr/local/mysql/lib/mysql and would get the error with .18 or .19. earlier version would work regradless.  I found that I had a similar problem with openssl till I started using this in my .profile.

LD_LIBRARY_PATH=\;/usr/lib:/lib:/usr/local/lib:/usr/local/mysql/lib/mysql:/usr/l
ocal/bdb/lib:/usr/local/ssl/lib:;export LD_LIBRARY_PATH

This resolved all the problems with openssl.  This is where I first found the dependency on the LD_LIBRARY_PATH.  Putting in /; so that env would give the below was the fix.

LD_LIBRARY_PATH=;/lib:/usr/lib:/usr/local/lib:/usr/ccs/lib:/usr/local/mysql/lib/mysql:/usr/local/bdb:/usr/gnu/lib:

I even tried adding the build directories before the \; and I always got the same error and problem with always wanting the library that is in /usr/local/mysql/lib/mysql before what is specified in LD_LIBRARY_PATH.

Which does not make any sense to me.  The ./configure scripts and every thing look correct to me.

Because I have never really had problems with production level versions of MySQL it is not really a problem doing and install and then a test but on the alpha and beta I always feel safer knowning the tests pass frist.
[1 Jun 2004 13:38] MySQL Verification Team
This is a problem of precedece of shared libs, in this case libmysqlclient.

This is purely SCO issue.

The reason of why it did not occur before is due to the changes in GNU config
scripts.

Start from the scratch. 

Add --disable-shared to configure options.
[5 Jun 2004 17:02] Boyd GERBER
I am now working with the OSS build utilities to fix some problems with their SW.  When MySQL updates to the latest versions of these Utilities the problem will be fixed.

This can be closed
[5 Jun 2004 17:04] Boyd GERBER
New Gnu utils will fix this problem.  I am working with the various projects to fix the issues.
[5 Jun 2004 17:22] MySQL Verification Team
As requested by much respected user.