Bug #8673 MySQL crash when creating a new database
Submitted: 22 Feb 2005 9:34 Modified: 23 Feb 2005 8:20
Reporter: Jan Lindström Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.3-bk OS:Linux (Linux 2.4.21-99-smp)
Assigned to: CPU Architecture:Any

[22 Feb 2005 9:34] Jan Lindström
Description:
I compiled MySQL with ./configure CFLAGS='-g3 -O0' CXXFLAGS='g3 -O0' LDFLAGS='g3 -O0'. Then I started mysqld and got following:

jan@hundin:~/mysql-5.0/sql> gdb mysqld
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /home/jan/mysql-5.0/sql/mysqld
[New Thread 16384 (LWP 13128)]
[New Thread 32769 (LWP 13130)]
[New Thread 16386 (LWP 13131)]
[New Thread 32771 (LWP 13132)]
[New Thread 49156 (LWP 13133)]
[New Thread 65541 (LWP 13134)]
InnoDB: The first specified data file /home/jan/sqldata/ibdata1 did not exist:
InnoDB: a new database to be created!
050222 10:06:23  InnoDB: Setting file /home/jan/sqldata/ibdata1 size to 20 MB
InnoDB: Database physically writes the file full: wait...
050222 10:06:24  InnoDB: Data file /home/jan/sqldata/ibdata2 did not exist: new to be created
050222 10:06:24  InnoDB: Setting file /home/jan/sqldata/ibdata2 size to 20 MB
InnoDB: Database physically writes the file full: wait...
050222 10:06:26  InnoDB: Data file /home/jan/sqldata/ibdata3 did not exist: new to be created
050222 10:06:26  InnoDB: Setting file /home/jan/sqldata/ibdata3 size to 10 MB
InnoDB: Database physically writes the file full: wait...
050222 10:06:26  InnoDB: Log file /home/jan/sqldata/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /home/jan/sqldata/ib_logfile0 size to 20 MB
InnoDB: Database physically writes the file full: wait...
050222 10:06:27  InnoDB: Log file /home/jan/sqldata/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /home/jan/sqldata/ib_logfile1 size to 20 MB
InnoDB: Database physically writes the file full: wait...
[New Thread 81926 (LWP 13135)]
[New Thread 98311 (LWP 13136)]
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
[New Thread 114696 (LWP 13137)]
050222 10:06:30  InnoDB: Started; log sequence number 0 0
[New Thread 131081 (LWP 13138)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 13128)]
0x4006775b in pthread_rwlock_init () from /lib/i686/libpthread.so.0
(gdb) where
#0  0x4006775b in pthread_rwlock_init () from /lib/i686/libpthread.so.0
#1  0x083866f6 in mi_open (name=0xbfffb3f0 "./mysql/host", mode=2,
    open_flags=2) at mi_open.c:483
#2  0x08229813 in ha_myisam::open(char const*, int, unsigned) (
    this=0x89d8af0, name=0xbfffb3f0 "./mysql/host", mode=2, test_if_locked=2)
    at ha_myisam.cc:228
#3  0x082257d7 in handler::ha_open(char const*, int, int) (this=0x89d8af0,
    name=0xbfffb3f0 "./mysql/host", mode=2, test_if_locked=2)
    at handler.cc:1112
#4  0x081bd5a1 in openfrm(THD*, char const*, char const*, unsigned, unsigned,unsigned, st_table*) (thd=0x89c7d38, name=0xbfffc5e0 "./mysql/host",
    alias=0x8461346 "host", db_stat=8231, prgflag=44, ha_open_flags=0,
    outparam=0x89d8510) at table.cc:797
#5  0x081b6b11 in open_unireg_entry (thd=0x89c7d38, entry=0x89d8510,
    db=0x898c610 "mysql", name=0x8461346 "host", alias=0x8461346 "host",
    table_desc=0xbfffefb0, mem_root=0xbfffedb0) at sql_base.cc:1487
#6  0x081b5b38 in open_table(THD*, st_table_list*, st_mem_root*, bool*) (
    thd=0x89c7d38, table_list=0xbfffefb0, mem_root=0xbfffedb0,
    refresh=0xbfffeddb) at sql_base.cc:1039
#7  0x081b70ba in open_tables(THD*, st_table_list*, unsigned*) (
    thd=0x89c7d38, start=0xbfffefb0, counter=0xbfffeedc) at sql_base.cc:1668
#8  0x081fe247 in acl_init(THD*, bool) (org_thd=0x0,
    dont_read_acl_tables=false) at sql_acl.cc:180
---Type <return> to continue, or q <return> to quit---
#9  0x0817fd0f in main (argc=1, argv=0xbffff414) at mysqld.cc:3049
(gdb) quit

How to repeat:
Start mysqld with no databases.
[22 Feb 2005 15:29] Miguel Solorzano
Jan I wasn't able to compile applying the ./configure option you
posted.
[22 Feb 2005 15:29] Miguel Solorzano
Jan I wasn't able to compile applying the ./configure option you
posted.
[22 Feb 2005 15:29] Miguel Solorzano
Jan I wasn't able to compile applying the ./configure option you
posted.
[23 Feb 2005 0:51] Miguel Solorzano
I changed your flags to:

./configure CFLAGS='-g3 -O0' CXXFLAGS='-g3 -O0' LDFLAGS=-'g3
-O0'
Changing g3 for -g3 in the second and third flags.
and I was able to compile and start the server without crash on Slackware 10
[23 Feb 2005 8:20] Jan Lindström
This is duplicate to bug #7186. I did not have privilege tables.