Bug #16586 drop pre-exist database has server die : undefined symbol: zlibCompileFlags
Submitted: 17 Jan 2006 22:28 Modified: 12 Apr 2007 23:11
Reporter: Ze Cheng Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.18 for x86_64 OS:Linux (Debian, cAos Linux 3.4.3)
Assigned to: Valeriy Kravchuk CPU Architecture:Any

[17 Jan 2006 22:28] Ze Cheng
Description:
Have searched reference, bug DB and google with no inspiring information returned. Have asked help in mailing list with no answers back.

version: 
	5.0.18

system: 
    CPU:  Dual AMD Opteron 250 (2.4 GHz, 1MB L2 Cache)
    RAM:  4GB (4 x 1GB) PC3200/DDR400 Registered ECC - Interleaved
    NIC:  Dual 10/100/1000 Mbps NIC (Broadcom 5704) - Integrated
    SATA Controller (PCI-X):  3Ware 9550SX-8LP 8 Port SATA II RAID
Controller w/128MB CACHE w/ BBU
    Low Profile PCI-X 1:  LSI 20320-R 1 Channel U320 SCSI Controller
    HDD 1:  Western Digital RE 120GB (1.5Gb/s, 7.2Krpm, 8MB Cache) SATA
    HDD 2:  Western Digital RE 120GB (1.5Gb/s, 7.2Krpm, 8MB Cache) SATA
    HDD 3:  Western Digital RE 320GB (1.5Gb/s, 7.2Krpm, 8MB Cache) SATA
    HDD 4:  Western Digital RE 320GB (1.5Gb/s, 7.2Krpm, 8MB Cache) SATA
    HDD 5:  Western Digital RE 320GB (1.5Gb/s, 7.2Krpm, 8MB Cache) SATA
    HDD 6:  Western Digital RE 320GB (1.5Gb/s, 7.2Krpm, 8MB Cache) SATA	

operating system: 
	cAos Linux 3.4.3

RAM: (by vmstat)
	procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
	 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
	 0  0    588 421056   6068 2848980    0    0     6    47    7     7  0  0 99  1

Disk usage of data dir:

	Filesystem            Size  Used Avail Use% Mounted on
	/dev/mapper/vg0-lv0   760G  4.2G  756G   1% /vol/00

compiler: 
	gcc 3.4.3

crash statement: 
	DROP DATABASE ggtest2;
Error message:
	ERROR 2013 (HY000): Lost connection to MySQL server during query

Files uploaded in mysqlBug_nodropDB_zlibCompileFlags.tar.gz
1. Trace file (option created trace: --user=mysql  --skip-external-locking  --socket=/var/lib/mysql/mysql.sock --debug=d,info,error,query,general,where:O,/tmp/mysqld.trace  --gdb  -O thread_cache_size=5  --core-file  --skip-stack-trace --one-thread): mysqld.trace
2. compile output : compile.output
3. Status output (mysqladmin -uroot -p variables extended-status processlist) : mysql_status.out
4. my.conf file: my.cnf (from modifying 
5. error log : mysqld.log

6. test database files (works fine under x86 5.0.15): ggtest2/*.* (please put it directly under the source dir of mysql and start server from there) Please keep the data  secret. 

Thanks for help. Please let me know if any further information needed.

How to repeat:
put ggtest2 directly under data dir of mysql, log in as DB admin, type

DROP DATABASE ggtest2;

no problem with dropping databases created from scratch
[18 Jan 2006 10:13] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I see neither mysqlBug_nodropDB_zlibCompileFlags.tar.gz nor any other file uploaded. Please, upload all files you want using the File tab, but take into account that each file should not be larger than 200K.
[30 Jan 2006 14:38] Valeriy Kravchuk
Sorry, but I was not able to repeat the problem you described on your database with latest 5.0.19-BK on Linux:

openxs@suse:~/dbs/5.0> cp -r /tmp/ggtest2/ var/
openxs@suse:~/dbs/5.0> ls -F var
ggtest2/     ib_logfile1  mysql/          suse-relay-bin.000006  test/
ibdata1      master.info  relay-log.info  suse-relay-bin.index
ib_logfile0  my.cnf       suse.err        suse-slow.log
openxs@suse:~/dbs/5.0> bin/mysqld_safe &
[1] 9355
openxs@suse:~/dbs/5.0> WARNING: Found /home/openxs/dbs/5.0/var/my.cnf
Datadir is deprecated place for my.cnf, please move it to /home/openxs/dbs/5.0

Starting mysqld daemon with databases from /home/openxs/dbs/5.0/var

openxs@suse:~/dbs/5.0> bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.19

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| ggtest2            |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> drop database ggtest2;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

So, in my case it works without any problems. Your case is much more complicated (according to the error log) - replication, binary logs index file disappered, missed binlog or incorrect index file, and only after all that:

/usr/sbin/mysqld-max: symbol lookup error: /usr/sbin/mysqld-max: undefined symbol: zlibCompileFlags

So, if you can propose a simple and repeatable set of steps to demonstrate this crash after a clean installation of 5.0.18 - please, do. Otherwise, I can not repeat the behaviour you described.
[30 Jan 2006 18:14] Ze Cheng
But did you try it on 5.0.18 for x86_64 (generic LINUX)? The way to recreate it is to put the whole directory 'ggtest2' (and the binary files in it) under the data directory of MySQL, then start the server. Then try 
'drop database ggtest2;'

As a matter of fact, I didn't see any problem with 5.0.15 for x86 LINUX. So I'm just wondering if it could be a problem only for x86_64 MySQLs.

Please let me know the result. Thanks.
[31 Jan 2006 7:13] Valeriy Kravchuk
OK, I'll try on x86_64 also and inform you about the results.
[31 Jan 2006 13:06] Valeriy Kravchuk
I've tried to repeat on x86_64, but still was not able to:

-bash-2.05b$ bin/mysqld_safe --socket=/users/vkravchuk/mysql5.sock --skip-networking --basedir=/users/vkravchuk/dbs/5.0-hammer --datadir=/users/vkravchuk/dbs/5.0-hammer/var --pid=/users/vkravchuk/dbs/5.0-hammer/mysqld.pid &
[1] 8082
-bash-2.05b$ Starting mysqld daemon with databases from /users/vkravchuk/dbs/5.0-hammer/var

-bash-2.05b$ bin/mysql --socket=/users/vkravchuk/mysql5.sock -uroot test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.18

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| ggtest2            |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.01 sec)

mysql> drop database ggtest2;
Query OK, 1 row affected (1.27 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.47 sec)

mysql> exit
Bye
-bash-2.05b$ tail var/hammer.mysql.com.err
060131 13:58:48  InnoDB: Shutdown completed; log sequence number 0 43655
060131 13:58:48 [Note] /users/vkravchuk/dbs/5.0-hammer/libexec/mysqld: Shutdown complete

060131 13:58:48  mysqld ended

060131 14:01:23  mysqld started
060131 14:01:28  InnoDB: Started; log sequence number 0 43655
060131 14:01:28 [ERROR] bdb:  architecture lacks fast mutexes: applications cannot be threaded
060131 14:01:28 [Note] /users/vkravchuk/dbs/5.0-hammer/libexec/mysqld: ready for connections.
Version: '5.0.18'  socket: '/users/vkravchuk/mysql5.sock'  port: 0  Source distribution
-bash-2.05b$ uname -a
Linux hammer.mysql.com 2.4.21-32.EL #1 Fri Apr 15 21:18:42 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux
-bash-2.05b$ ls -F var
hammer.mysql.com.err  ibdata1  ib_logfile0  ib_logfile1  mysql/  test/

I built that 5.0.18 from sources, with configure similar to your one from the private file you uploaded. I also put your binaries in that database before drop. No server crash, anyway.
[31 Jan 2006 18:34] Ze Cheng
Mr. Kravchuk,
      Thank you for all you did to restore the problem. If that is the case, I don't know what to say. Maybe it is the problem of my operating system, which is caos 3.4.3. 
      
ginger
[9 Jul 2006 0:49] Steve Slater
This bug is real, but not related to a pre-existing db. I built mysql 5.0.19 from src rpm on Suse 9.0. Same spec file but added in openssl support. I then tried with MySQL-*-5.0.22-0.glibc23.i386 from mysql.com and it does the same thing. I was running the mysqld-max pkg each time, and running on SuSE 9.0. I had to do a --nodeps to get around the procps pacakge missing (it's there but not as a pkg).

Here is what I can to re-create repeatedly:

Just after I installed for the first time I do this:

server:/tmp # mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.22-max-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database aa;
Query OK, 1 row affected (0.05 sec)

mysql> use aa
cDatabase changed
mysql> create table bb (i int);
Query OK, 0 rows affected (0.12 sec)

mysql> drop database aa;

at which point it hangs and throws this in the error log:

/usr/sbin/mysqld-max: relocation error: /usr/sbin/mysqld-max: undefined symbol: zlibCompileFlags

I have to kill -9 all of the mysql processes to restart. Any time I drop a db it does this. 

If i first remove all of the tables in the DB, then it will NOT hang and will remove correctly. 

So it looks like it hangs any time I try to drop a database that has tables in it.

Steve
[18 Feb 2007 18:09] Christian Hammers
I received two bug reports against the Debian packages that I maintain from users who report exactly the same "undefined symbol" message. I could not yet figure out what they did wrong as both the stable and out testing release have a zlib with this symbol in it.. If anybody has a clue, please drop me a line :)

The mentioned bug report is at http://bugs.debian.org/411392

bye,

-christian-
[4 Mar 2007 19:36] Valeriy Kravchuk
Please, try to repeat with a newer ver\sion of MySQL server, 5.0.33 at least, and check that libz version 1.2.3 is really used. Inform about the results.
[14 Mar 2007 0:02] Christian Hammers
FYI: The user in the Debian bug report http://bugs.debian.org/411392 had an outdated version of libz laying around in /lib so that Debian's version in /usr/lib was not used. After removing the ancient version the problem vanished.

bye,

-christian-
[4 Apr 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[5 Apr 2007 16:10] Valeriy Kravchuk
Closed as not a result of bug in MySQL's code.
[12 Apr 2007 23:11] Ze Cheng
Yeah, that works. With zlib version 1.2.3 and MySQL 5.0.24, dropping of a pre-defined database does not result in server crash.

Thank you for spending time on this