List:Bugs« Previous MessageNext Message »
From:sasha Date:March 15 2000 9:04pm
Subject:Re: Bug
View as plain text  
"Andre D. Henry" wrote:
> 
> While using phpMyAdmin I noiced that mysqld would sometimes crash on
> connect. I was able to reproduce the problem using 6 .sql files and
> and a shell script. The package causes a memory fault(coredump)  error on
> my machine.
> 
> *******Machine Info*****************
> 
> SGI Origin 200 256MB Ram Dual 225Mhz CPU's IRIX 5.6.7m
> mysql-3.22.32 (Source distribution)
> System: IRIX64 hostname 6.5 01200532 IP27
> Some paths:  /usr/sbin/perl /sbin/make /usr/gnu/bin/gmake /usr/bin/cc
> Compilation info: CC='cc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
> Configure command: ./configure  --prefix=/opt/web/mysql --enable-large-files
> --with-mysqld-user=mysql --without-debug --with-low-memory --with-pthread
> --enable-thread-safe-client
> Perl: This is perl, version 5.004_04 built for irix-n32
> 
> `file mysqld`
> mysqld:         ELF N32 MSB mips-4 dynamic executable (not stripped) MIPS -
>                 version 1
> 
> `ldd mysqld`
>         libdl.so  =>     /usr/lib32/libdl.so
>         libnsl.so  =>    /usr/lib32/libnsl.so
>         libsocket.so  =>         /usr/lib32/libsocket.so
>         libz.so  =>      /usr/freeware/lib/libz.so
>         libcrypt.so  =>  /usr/lib32/libcrypt.so
>         libgen.so  =>    /usr/lib32/libgen.so
>         libpthread.so  =>        /usr/lib32/libpthread.so
>         libm.so  =>      /usr/lib32/libm.so
>         libc.so.1  =>    /usr/lib32/libc.so.1
> 
> *************** Output of `gdb mysqld core` and then issuing a where command
> 
> #0  0x1003a5f0 in resolve_const_item (item=0x10a1ab78, cmp_item=0x10a1ab00)
>     at item.cc:620
> 620         return new Item_string(name,tmp_str,length);
> (gdb) where
> #0  0x1003a5f0 in resolve_const_item (item=0x10a1ab78, cmp_item=0x10a1ab00)
>     at item.cc:620
> #1  0x100f69b8 in propagate_cond_constants (save_list=0x10a770e0,
>     and_level=0x10a1ac38, cond=0x10a1abd0) at sql_select.cc:2311
> #2  0x100f6808 in propagate_cond_constants (save_list=0x0, and_level=0x1,
>     cond=0x10a1ac38) at sql_select.cc:2284
> #3  0x100f6b10 in optimize_cond (conds=0x10a1ac38, cond_value=0x10a77a20)
>     at sql_select.cc:2342
> #4  0x100eefb8 in mysql_select (thd=0x10209fd0, tables=0x10a1a9d8,
>     fields=@0x1020a364, conds=0x10a1ac38, order=0x0, group=0x0, having=0x0,
>     proc_param=0x0, select_options=5120, result=0x10a1aca0)
>     at sql_select.cc:280
> #5  0x100cb81c in mysql_execute_command () at sql_parse.cc:687
> #6  0x100cd63c in mysql_parse (thd=0x10209fd0,
>     inBuf=0x10a1a838 "SELECT User, Password, Select_priv FROM user where User =
> 'root' AND Password = PASSWORD('iso9660x')", length=270573816)
>     at sql_parse.cc:1377
> #7  0x100caa44 in do_command (thd=0x10209fd0) at sql_parse.cc:428
> #8  0x100ca3a8 in handle_one_connection (arg=0x10209fd0) at sql_parse.cc:292
> #9  0xc24bdbc in _SGIPT_pt_start () at pt.c:793
> 
> *****************Sql and shell script to reproduce problem
> 
> t1.sql
> SELECT User, Password, Select_priv FROM user where User = 'root' AND Password =
> PASSWORD('xxxxxxxx');
> Quit
> 
> t2.sql
> SELECT VERSION() AS version;
> Quit
> 
> t3.sql
> SELECT User, Password, Select_priv FROM user where User = 'root' AND Password =
> PASSWORD('xxxxxxxxxx');
> Quit
> 
> t4.sql
> SELECT VERSION() AS version;
> show databases;
> use mysql;
> show tables;
> Quit
> 
> t5.sql
> select * from user where User="root";
> use mysql
> select * from db where User="root";
> use mysql;
> SELECT User, Password, Select_priv FROM user where User = 'root' AND Password =
> PASSWORD('xxxxxxx');
> quit
> 
> t6.sql
> SELECT User, Password, Select_priv FROM user where User = 'root' AND Password =
> PASSWORD('xxxxxx');
> SELECT VERSION() AS version;
> SELECT User, Password, Select_priv FROM user where User = 'root' AND Password =
> PASSWORD('xxxxx');
> SELECT VERSION() AS version;
> SELECT Version() as version;
> Quit
> 
> test.sh
> 
> while true; do
>    echo **************T1********************
>    mysql -u admin -pxxxxx -h xxx.xxxt.xxx mysql < t1.sql &
>    echo **************T2********************
>    mysql -u root -pxxxxx -h xxx.xxxt.xxx mysql mysql < t2.sql&
>    echo **************T3********************
>    mysql -u admin -pxxxxx -h xxx.xxxt.xxx mysql mysql < t3.sql &
>    echo **************T4********************
>    mysql -u root -pxxxxx -h xxx.xxxt.xxx mysql mysql < t4.sql &
>    echo **************T5********************
>    mysql -u admin -pxxxxx -h xxx.xxxt.xxx mysql mysql < t5.sql &
>    echo **************T6********************
>    mysql -u root -pxxxxx -h xxx.xxxt.xxx mysql mysql < t6.sql &
> 
>    sleep 1
> done
> 
> *************Table Schema
> 
> #!/bin/sh
> Database mysql
> 
> # phpMyAdmin MySQL-Dump
> # http://phpwizard.net/phpMyAdmin/
> #
> # Host: bigo.go-net.com Database : mysql
> 
> # --------------------------------------------------------
> #
> # Table structure for table 'columns_priv'
> #
> 
> CREATE TABLE columns_priv (
>    Host char(60) NOT NULL,
>    Db char(60) NOT NULL,
>    User char(16) NOT NULL,
>    Table_name char(60) NOT NULL,
>    Column_name char(60) NOT NULL,
>    Timestamp timestamp(14),
>    Column_priv set('Select','Insert','Update','References') NOT NULL,
>    PRIMARY KEY (Host, Db, User, Table_name, Column_name)
> );
> 
> #
> # Dumping data for table 'columns_priv'
> #
> 
> # --------------------------------------------------------
> #
> # Table structure for table 'db'
> #
> 
> CREATE TABLE db (
>    Host char(60) NOT NULL,
>    Db char(32) NOT NULL,
>    User char(16) NOT NULL,
>    Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    References_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    PRIMARY KEY (Host, Db, User),
>    KEY User (User)
> );
> 
> #
> # Dumping data for table 'db'
> #
> 
> INSERT INTO db VALUES( '%', 'test', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
> 'Y');
> INSERT INTO db VALUES( '%', 'test\\_%', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
> 'Y', 'Y');
> 
> # --------------------------------------------------------
> #
> # Table structure for table 'func'
> #
> 
> CREATE TABLE func (
>    name char(64) NOT NULL,
>    ret tinyint(1) DEFAULT '0' NOT NULL,
>    dl char(128) NOT NULL,
>    type enum('function','aggregate') DEFAULT 'function' NOT NULL,
>    PRIMARY KEY (name)
> );
> 
> #
> # Dumping data for table 'func'
> #
> 
> # --------------------------------------------------------
> #
> # Table structure for table 'host'
> #
> 
> CREATE TABLE host (
>    Host char(60) NOT NULL,
>    Db char(32) NOT NULL,
>    Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    References_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    PRIMARY KEY (Host, Db)
> );
> 
> #
> # Dumping data for table 'host'
> #
> 
> # --------------------------------------------------------
> #
> # Table structure for table 'tables_priv'
> #
> 
> CREATE TABLE tables_priv (
>    Host char(60) NOT NULL,
>    Db char(60) NOT NULL,
>    User char(16) NOT NULL,
>    Table_name char(60) NOT NULL,
>    Grantor char(77) NOT NULL,
>    Timestamp timestamp(14),
>    Table_priv
> set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter')
> NOT NULL,
>    Column_priv set('Select','Insert','Update','References') NOT NULL,
>    PRIMARY KEY (Host, Db, User, Table_name),
>    KEY Grantor (Grantor)
> );
> 
> #
> # Dumping data for table 'tables_priv'
> #
> 
> # --------------------------------------------------------
> #
> # Table structure for table 'user'
> #
> 
> CREATE TABLE user (
>    Host char(60) NOT NULL,
>    User char(16) NOT NULL,
>    Password char(16) NOT NULL,
>    Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    File_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    References_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,
>    PRIMARY KEY (Host, User)
> );
> 
> #
> # Dumping data for table 'user'
> #
> 
> INSERT INTO user VALUES( 'localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
> 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
> INSERT INTO user VALUES( 'xxxxx.xxxx.com', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
> 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
> INSERT INTO user VALUES( 'localhost', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
> 'N', 'N', 'N', 'N', 'N', 'N');
> INSERT INTO user VALUES( 'xxxxx.xxxx.com', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
> 'N', 'N', 'N', 'N', 'N', 'N', 'N');
> INSERT INTO user VALUES( 'xxxxx.xxxx.com', 'root', '65495b221ef80aa9', 'Y', 'Y', 'Y',
> 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
> INSERT INTO user VALUES( 'xxxxx.xxxx.com', 'admin', '7a9e31c36a353177', 'Y', 'N',
> 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N');
> 

Thanks for a good bug report. The segfault is happening in the very well tested
area of code, and probably has to do with  linking against buggy libraries, or
some other form of binary corruption. To eliminate the possibility, can you do
the following:

 - make sure that your script reliably repeats the problem
 - bring your system to the latest patch level
 - build from source in a new directory from a fresh tarball
 - see if the problem persists.

-- 
Sasha Pachev

+------------------------------------------------------------------+
| TcX  ____  __     _____   _____  ___     ==  mysql@stripped        |
|     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sasha Pachev            |
|    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sasha@stripped  |
|   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Provo, Utah, USA        |
|  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                         |
|  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                        |
|             /*/             \*\ Developers Team                  |
+------------------------------------------------------------------+
Thread
BugAndre D. Henry15 Mar
  • Re: Bugsasha16 Mar
    • Re: BugAndre D. Henry16 Mar