Bug #13791 mysqld crashes at startup in 5.0.15bk
Submitted: 6 Oct 2005 1:59 Modified: 6 Oct 2005 18:47
Reporter: Jorge del Conde Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.15-rc from BK OS:Linux (Linux/Windows)
Assigned to: Sergei Golubchik CPU Architecture:Any

[6 Oct 2005 1:59] Jorge del Conde
Description:
I just installed a brand new tree from bk, and when starting mysql up, the daemon immediately dies.

Here's a copy of my error log:

root@laptop-/usr/local/mysql/# cat data/laptop.err 
051005 20:56:29  mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
051005 20:56:30  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
051005 20:56:30  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...
051005 20:56:30  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
051005 20:56:31  InnoDB: Started; log sequence number 0 0
mysqld got signal 11;
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=131072
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 = 217599 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...
Cannot determine thread, fp=0xbff41a24, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x80b94af
0x7ee420
(nil)
0x82c2ff0
0x81214c7
0x80b6593
0x80b98f5
0x8302a95
0x8048141
New value of fp=(nil) 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
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.
051005 20:56:31  mysqld ended

NOTE:  running with '--skip-innodb' starts mysql successfully.

How to repeat:
read above
[6 Oct 2005 3:51] Marko Mäkelä
In a compile-pentium-debug build, there is some more information in the error log.
InnoDB itself seems to start up fine, even when upgrading from 4.0 to 5.0. The error appears to occur during the MySQL initialization, in the tc_log->open() call in init_server_components(), file mysqld.cc. Here is an excerpt from the error log when starting InnoDB from the scratch, using mysql 4.0 system tables (if it matters).

051006  6:58:40  InnoDB: Started; log sequence number 0 0
/home/marko/mysql-5.0-bk/sql/mysqld: Can't change size of file (Errcode: 9)
051006  6:58:40 [ERROR] Can't init tc log
051006  6:58:40 [ERROR] Aborting

051006  6:58:40  InnoDB: Starting shutdown...
051006  6:58:43  InnoDB: Shutdown completed; log sequence number 0 43655
051006  6:58:43 [Note] /home/marko/mysql-5.0-bk/sql/mysqld: Shutdown complete

I believe that this may be due to a change outside of InnoDB.

Interestingly, the datadir contains a file "0" of length 0 and permissions 000.
[6 Oct 2005 4:01] Marko Mäkelä
I added a debug print right before the tc_log->open() call in init_server_components().
When --skip-innodb is specified, tc_log_dummy will be used. When InnoDB is enabled, tc_log_mmap will be used. This looks like a bug in tc_log_mmap, thus not an InnoDB bug.

Of course, I may be seeing some other problem. An unresolved stack trace of a development snapshot does not say anything. Please, always resolve stack traces.
[6 Oct 2005 11:59] MySQL Verification Team
I have experienced this bug too and discussed it with Kent on IRC,
for to happen you need to start the server without a default my.cnf
which contents the basedir. If you use for example:

libexec/mysqld --defaults-file=/path/my.cnf 

the server starts without problem.

This also happens on Windows.
[6 Oct 2005 17:08] 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/30775