Bug #24450 Crashes on create table
Submitted: 21 Nov 2006 3:03 Modified: 22 Nov 2006 8:34
Reporter: Lars Yencken Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.26-r1 OS:Linux (Gentoo, Ubuntu (EM64T))
Assigned to: CPU Architecture:Any

[21 Nov 2006 3:03] Lars Yencken
Description:
This version of mysql crashes on the first table create that occurs, and is unable to proceed. After that table create, the server will not restart. If you delete the database, reconfigure, and restart the server, it will start up again.

I wasn't getting much information from the mysql log, but I recompiled with debugging, and this was the dump.

061121 10:41:59 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=zero-bin' to avoid this problem.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
061121 10:41:59  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
061121 10:42:00  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
061121 10:42:00  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
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
061121 10:42:00  InnoDB: Started; log sequence number 0 0
061121 10:42:00 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.26-debug-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Gentoo Linux mysql-5.0.26-r1
mysqld got signal 4;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=16777216
read_buffer_size=258048
max_used_connections=1
max_connections=100
threads_connected=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 92780 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x1522f28
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x43888180, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
(nil)
New value of fp=0x1522f28 failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do 
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x152b128 = CREATE TABLE rawStimulus ( id INT(11) NOT NULL auto_increment,
kanjiA CHAR(3) DEFAULT NULL,
kanjiB CHAR(3) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
thd->thread_id=6
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
061121 10:47:40 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=zero-bin' to avoid this problem.
061121 10:47:41  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
061121 10:47:41  InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43655.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
mysqld got signal 4;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=0
read_buffer_size=258048
max_used_connections=0
max_connections=100
threads_connected=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 76396 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=(nil)
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
frame pointer is NULL, did you compile with
-fomit-frame-pointer? Aborting backtrace!
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.

-------------------

It reports its exact version as:

mysql  Ver 14.12 Distrib 5.0.26, for pc-linux-gnu (x86_64) using readline 5.1

It was compiled with CFLAGS: -march=athlon64 -O2 -pipe

Processor is a recent Pentium D supporting 64-bit instructions.

Thanks!
Lars

How to repeat:
This does it, but other randomly selected tables of mine seem to as well.

CREATE TABLE rawStimulus ( id INT(11) NOT NULL auto_increment,
kanjiA CHAR(3) DEFAULT NULL,
kanjiB CHAR(3) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
[21 Nov 2006 3:22] Lars Yencken
Ok, perhaps I had been misled by some gentoo documentation on cflags. I recompiled mysql with -march=nocona and it works fine. Mysql is the only piece of software which has broken using -march=amd64, so it must be the only one which specialises to processors to that degree.

I'd consider this not a bug, and I've added some documentation to a gentoo wiki on "safe cflags" to indicate that -march=amd64 might break things. I'll try recompiling without debug flags, but I doubt I'll have a problem.
[21 Nov 2006 3:23] Lars Yencken
Marking this as not a bug.
[22 Nov 2006 8:34] Lars Yencken
Further investigation suggests that gcc is incorrectly compiling these packages to use an amd64 specific instruction, rather than a generic x86_64 instruction, even when compiled with the correct -mtune=generic (?) CFLAG. I've personally experienced this crash on current Gentoo, and on the latest mysql-server-5.0 package in Ubuntu Edgy. Using an older version of mysql5 on edgy fixed this problem for me.

https://launchpad.net/distros/ubuntu/+source/gcc-4.1/+bug/66702