Bug #13238 mysqldump and mysqladmin hangs
Submitted: 15 Sep 2005 22:32 Modified: 20 Oct 2005 8:30
Reporter: Dean Grimes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.14 OS:Other (SCO OpenServer)
Assigned to: Alexander Barkov CPU Architecture:Any

[15 Sep 2005 22:32] Dean Grimes
Description:
mysqladmin and mysqldump hang. After starting mysql with or without innodb support and I try to run mysqladmin status or try to dump a table with mysqldump the programs just sit there. I configured with the following:

configure       --prefix=/d/mysql --without-berkeley-db --without-docs --with-debug --without-bench

make
make install

Everything compiled and installed without error. In fact, the server and client work just fine even with innodb support. I'm not having any problems with the database system only the utilities.

My OS is SCO 5.0.4. and I'm using FSU-pthreads 3.14, zlib 1.1.4

gdb shows the following:

(gdb) set args status
(gdb) run
Starting program: /usr/local/bin/mysqladmin status

Program received signal SIGSEGV, Segmentation fault.
0x8007fc77 in my_once_alloc (Size=256, MyFlags=16) at my_once.c:50
50        for (next=my_once_root_block ; next && next->left < Size ; next= next-
>next)
Current language:  auto; currently c
(gdb)

backtrace produces:

Program received signal SIGSEGV, Segmentation fault.
0x8007fc77 in my_once_alloc (Size=256, MyFlags=16) at my_once.c:50
50        for (next=my_once_root_block ; next && next->left < Size ; next= next-
>next)
Current language:  auto; currently c
(gdb) backtrace
#0  0x8007fc77 in my_once_alloc (Size=256, MyFlags=16) at my_once.c:50
#1  0x8008017c in init_state_maps (cs=0x800c17a0) at charset.c:47
#2  0x800809ee in init_available_charsets (myflags=0) at charset.c:399
#3  0x80080a96 in get_collation_number (name=0x7d5d6d4 "big5_chinese_ci")
    at charset.c:423
#4  0x800804f2 in add_collation (cs=0x7d5ddbc) at charset.c:192
#5  0x80088d82 in cs_leave (st=0xe8,
    attr=0x7d5dea4 "charsets.charset.collation", len=26) at ctype.c:206
#6  0x8008e187 in my_xml_leave (p=0x7d5de24, str=0x800c1720 "Ó", slen=256)
    at xml.c:183
#7  0x8008e28a in my_xml_parse (p=0x7d5de24, str=0xe8 "", len=17796)
    at xml.c:224
#8  0x800891d7 in my_parse_charset_xml (
    buf=0x9ab8cbc "<?xml version='1.0' encoding=\"utf-8\"?>\n\n<charsets max-id=
\"96\">\n\n<copyright>\n Copyright (C) 2003 MySQL AB\n\n  This program is free s
oftware; you can redistribute it and/or modify\n  it under the terms of"...,
    len=17796, add_collation=0x800804c0 <add_collation>) at ctype.c:314
#9  0x800807d1 in my_read_charset_file (filename=0x8 "", myflags=0)
    at charset.c:314
#10 0x80080a39 in init_available_charsets (myflags=0) at charset.c:405
#11 0x80080a96 in get_collation_number (name=0x7d5e3f4 "big5_chinese_ci")
    at charset.c:423
#12 0x800804f2 in add_collation (cs=0x7d5eadc) at charset.c:192
#13 0x80088d82 in cs_leave (st=0xe8,
---Type <return> to continue, or q <return> to quit---
    attr=0x7d5ebc4 "charsets.charset.collation", len=26) at ctype.c:206
#14 0x8008e187 in my_xml_leave (p=0x7d5eb44, str=0x800c1720 "Ó", slen=256)
    at xml.c:183
#15 0x8008e28a in my_xml_parse (p=0x7d5eb44, str=0xe8 "", len=17796)
    at xml.c:224
#16 0x800891d7 in my_parse_charset_xml (
    buf=0x9ab1740 "<?xml version='1.0' encoding=\"utf-8\"?>\n\n<charsets max-id=
\"96\">\n\n<copyright>\n Copyright (C) 2003 MySQL AB\n\n  This program is free s
oftware; you can redistribute it and/or modify\n  it under the terms of"...,
    len=17796, add_collation=0x800804c0 <add_collation>) at ctype.c:314
#17 0x800807d1 in my_read_charset_file (filename=0x8 "", myflags=0)
    at charset.c:314
#18 0x80080a39 in init_available_charsets (myflags=0) at charset.c:405
#19 0x80080a96 in get_collation_number (name=0x7d5f114 "big5_chinese_ci")
    at charset.c:423
#20 0x800804f2 in add_collation (cs=0x7d5f7fc) at charset.c:192
#21 0x80088d82 in cs_leave (st=0xe8,
    attr=0x7d5f8e4 "charsets.charset.collation", len=26) at ctype.c:206
#22 0x8008e187 in my_xml_leave (p=0x7d5f864, str=0x800c1720 "Ó", slen=256)
    at xml.c:183
#23 0x8008e28a in my_xml_parse (p=0x7d5f864, str=0xe8 "", len=17796)
    at xml.c:224
#24 0x800891d7 in my_parse_charset_xml (
    buf=0x9aaa1c4 "<?xml version='1.0' encoding=\"utf-8\"?>\n\n<charsets max-id=
---Type <return> to continue, or q <return> to quit---
\"96\">\n\n<copyright>\n Copyright (C) 2003 MySQL AB\n\n  This program is free s
oftware; you can redistribute it and/or modify\n  it under the terms of"...,
    len=17796, add_collation=0x800804c0 <add_collation>) at ctype.c:314
#25 0x800807d1 in my_read_charset_file (filename=0x8 "", myflags=0)
    at charset.c:314
#26 0x80080a39 in init_available_charsets (myflags=0) at charset.c:405
#27 0x80080a96 in get_collation_number (name=0x7d5fe34 "big5_chinese_ci")
    at charset.c:423
#28 0x800804f2 in add_collation (cs=0x7d6051c) at charset.c:192
#29 0x80088d82 in cs_leave (st=0xe8,
    attr=0x7d60604 "charsets.charset.collation", len=26) at ctype.c:206
#30 0x8008e187 in my_xml_leave (p=0x7d60584, str=0x800c1720 "Ó", slen=256)
    at xml.c:183
#31 0x8008e28a in my_xml_parse (p=0x7d60584, str=0xe8 "", len=17796)
    at xml.c:224
#32 0x800891d7 in my_parse_charset_xml (
    buf=0x9aa2c48 "<?xml version='1.0' encoding=\"utf-8\"?>\n\n<charsets max-id=
\"96\">\n\n<copyright>\n Copyright (C) 2003 MySQL AB\n\n  This program is free s
oftware; you can redistribute it and/or modify\n  it under the terms of"...,
    len=17796, add_collation=0x800804c0 <add_collation>) at ctype.c:314
#33 0x800807d1 in my_read_charset_file (filename=0x8 "", myflags=0)
    at charset.c:314
#34 0x80080a39 in init_available_charsets (myflags=0) at charset.c:405

and it just goes on and on and on...... It appears to be stuck in a loop.

How to repeat:
mysqladmin status or mysqldump mysql users
[16 Sep 2005 11:44] Valeriy Kravchuk
I tried to repeat on today's nightly build of 4.1.15, but was unable. I compiled MySQL from sources after the following configure:

CC=cc CFLAGS="-I/opt/K/SCO/Unix/6.0.0Ni/usr/include -I/usr/local/include" CXX=CC \
CXXFLAGS="-I/opt/K/SCO/Unix/6.0.0Ni/usr/include -I/usr/local/include" ./configure --prefix=/home/mysqldev/valeriy/4.1 \
--with-comment="MySQL Pro (GPL)" --with-extra-charsets=complex \
--with-server-suffix="-pro-gpl" --enable-thread-safe-client \
--enable-local-infile --build=i686-unknown-sysv5SCO_SV6.0.0 \
--disable-shared --with-readline --with-archive-storage-engine \
--with-innodb --with-debug

Then I performed the regular procedures, and started the server.

bash-2.03$ bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-nightly-20050916-pro-gpl-debug

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

mysql> use test;
Database changed
mysql> exit

After that I performed the commands you proposed:

bash-2.03$ bin/mysqldump -uroot mysql user
-- MySQL dump 10.9
--
-- Host: localhost    Database: mysql
-- ------------------------------------------------------
-- Server version       4.1.15-nightly-20050916-pro-gpl-debug

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `Host` varchar(60) collate utf8_bin NOT NULL default '',
  `User` varchar(16) collate utf8_bin NOT NULL default '',
  `Password` varchar(41) collate utf8_bin NOT NULL default '',
  `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Reload_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Shutdown_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Process_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `File_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `References_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Show_db_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Super_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N',

  `Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Repl_slave_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `Repl_client_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
  `ssl_type` enum('','ANY','X509','SPECIFIED') character set utf8 NOT NULL defau
lt '',
  `ssl_cipher` blob NOT NULL,
  `x509_issuer` blob NOT NULL,
  `x509_subject` blob NOT NULL,
  `max_questions` int(11) unsigned NOT NULL default '0',
  `max_updates` int(11) unsigned NOT NULL default '0',
  `max_connections` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`Host`,`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global
privileges';

--
-- Dumping data for table `user`
--

/*!40000 ALTER TABLE `user` DISABLE KEYS */;
LOCK TABLES `user` WRITE;
INSERT INTO `user` VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y'
,'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0),('opnsrv
6a.mysql.com','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',
'Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0),('opnsrv6a.mysql.com','','','N','
N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','
','','','',0,0,0),('localhost','','','N','N','N','N','N','N','N','N','N','N','N'
,'N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);
UNLOCK TABLES;
/*!40000 ALTER TABLE `user` ENABLE KEYS */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

bash-2.03$ bin/mysqladmin status
Uptime: 187  Threads: 1  Questions: 22  Slow queries: 0  Opens: 11  Flush tables: 1  Open tables: 5  Queries per second avg: 0.118
bash-2.03$ uname -a
SCO_SV opnsrv6a 5 6.0.0 i386

So, it works as expected. I'd recommend you to wait for the 4.1.15 official release and try to install it on your SCO box. It should work much better on this platform now.
[16 Sep 2005 13:39] Dean Grimes
Both utilities are hung in the same routine. Is there a way to compile just mysqladmin with different options?
[16 Sep 2005 14:45] Valeriy Kravchuk
Use --without-server configure option
(http://dev.mysql.com/doc/mysql/en/configure-options.html)
[16 Sep 2005 22:26] Dean Grimes
Here is a new wrinkle to this: I noticed that MySQL was compiling with the bundled zlib because it determined that there was no system wide reference to zlib. So I did a little searching around and noticed that zlib.h and zconf.h were not in the /usr/local/include directory - although the libz.a and libz.so libraries (ver 1.1.4) were in the /usr/local/lib directory. So I downloaded the latest zlib-1.2.3, compiled the static and shared libraries and installed them.

Now MySQL did see that there was a system wide reference for zlib and completed it's configure, make and make install with no problems. However, now when I try to run mysqldump or mysqladmin or the mysql client I get:

dynamic linker: mysql: relocation error: symbol not found: main
Killed

It looks like it couldn't find the symbol main - which indicates a pretty serious problem. But, mysql server starts and runs just fine.

Any ideas?

Dean
[19 Sep 2005 13:45] Dean Grimes
In debugging this is what I have found: 

The function my_parse_charset_xml in ctype.c is where the system is hung up. It's recursivly called in a loop which runs until it core dumps. The really strange behavior though is the zlib phenomena. If I allow MySQL to use zlib in /usr/local, I get:

dynamic linker: mysqladmin: relocation error: symbol not found: main
Killed

If I let it use zlib bundled with MySQL I have the hanging problem. I'm going to reload my entire development system from scratch just to be sure that I don't have a library issue on my system. However, I don't think that I do. I have also tested on a 5.0.6 system and I'm experiencing the same problem.

Thanks,
Dean
[20 Sep 2005 12:17] Dean Grimes
I figured out the weird zlib issue. I noticed in the lib/mysql directory were compiled modules of zlib that took the form of libz.so.0.0.0 and libz.so.0 with references linked into the /usr/local/lib directory. Once I removed those zlib files and put zlib-1.2.3 in /usr/local everything compiled and I no longer get the dynamic linker problem. It was necessary to remove the libz.so.0.0.0 from lib/mysql though. However, I still have the hanging problem.

When is 4.1.15 due to be released?

Dean
[27 Sep 2005 9:47] Sergei Golubchik
The hang is real - though you apparently have corrupted Index.xml file (in share/mysql/charsets).
nevertheless mysqld should not hung if that file is corrupted.
[7 Oct 2005 5:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/30798
[20 Oct 2005 7:43] Alexander Barkov
Fixed in 5.0.16 and 4.1.16.
[20 Oct 2005 8:30] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 4.1.16 and 5.0.16 changelogs; closed.