Bug #9542 MySQL dies with signal 11 when it is using non-existent location of binary logs
Submitted: 31 Mar 2005 21:16 Modified: 25 Apr 2005 16:11
Reporter: Gleb Paharenko Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-beta OS:Linux (Linux)
Assigned to: Guilhem Bichot CPU Architecture:Any

[31 Mar 2005 21:16] Gleb Paharenko
Description:
When in my.cnf the wrong path is pointed  for binary logs MySQL server dies with SIG 11 (however it prints into error log the error about wrong path). I think mysqld shouldn't die even with wrong configuration, but should put only an error message.

How to repeat:

I didn't have  /home/gleb/mysqls/logs/log_j directory. And my.cnf was

# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password	= your_password
port		= 3724
socket		= /home/gleb/mysqls/tmp/mysql.sock.gleb.j
default_character_set=cp1251
#default_character_set=latin1
# Here follows entries for some specific programs
character-sets-dir= /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/share/mysql/charsets
# The MySQL server
[mysqld]
#ft_stopword_file=/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/ftopfile.txt
log-long-format
default_character_set=cp1251
default-collation=cp1251_bin
log_slow_queries=/home/gleb/mysqls/logs/mysql.log-slow.j
long_query_time=1
myisam_data_pointer_size=4
#old_passwords
log_warnings=2
set-variable=user=gleb
#character_set_database = gbk
#collation_database = gbk_bin
#character_set_server=gbk 
#default_character_set=latin1
#lower_case_table_names=1
port		= 3724
socket		= /home/gleb/mysqls/tmp/mysql.sock.gleb.j
skip-locking
pid-file	= /home/gleb/mysqls/tmp/mysql.pid.gleb.j
log		= /home/gleb/mysqls/logs/mysql.log.j
log-bin		= /home/gleb/mysqls/logs/log_j/log_j
log-error	= /home/gleb/mysqls/logs/mysql.log-error.j
datadir		=/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
wait_timeout=1000

interactive_timeout=50
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
# 
#skip-networking
#skip-innodb
server-id	= 1
#replicate-rewrite-db=test->test2; 
# Uncomment the following if you want to log updates
#log-bin

# Uncomment the following if you are NOT using BDB tables
#skip-bdb

innodb_data_home_dir=/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data
innodb_data_file_path = ibdata1:10M;ibdata2:50M:autoextend

#innodb_log_group_home_dir = /usr/local/mysql/data/
innodb_log_group_home_dir =/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data

#innodb_log_arch_dir = /usr/local/mysql/data/

innodb_log_arch_dir =/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/data/
#innodb_log_arch_dir = /usr/local/mysql/data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M
default_character_set = latin1
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
#default_character_set=utf8
#default_character_set=latin1
#default-character-set=utf8
[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
character-sets-dir=/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/share/mysql/charsets

[mysqlhotcopy]
interactive-timeout

####################################################################

Resolved stack-trace with peace of error log:

050401 00:44:52  mysqld started
^G/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/bin/mysqld: File '/home/gleb/mysqls/logs/log_j/log_j.index'
 not found (Errcode: 2)
InnoDB: The first specified data file /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data/ibdata1 did not ex
ist:
InnoDB: a new database to be created!
050401  0:44:53  InnoDB: Setting file /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data/ibdata1 size to 10
 MB
InnoDB: Database physically writes the file full: wait...
050401  0:44:55  InnoDB: Data file /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data/ibdata2 did not exist
: new to be created
050401  0:44:55  InnoDB: Setting file /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data/ibdata2 size to 50
 MB
InnoDB: Database physically writes the file full: wait...
050401  0:45:05  InnoDB: Log file /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data/ib_logfile0 did not ex
ist: new to be created
InnoDB: Setting log file /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data/ib_logfile0 size to 5 MB

InnoDB: Database physically writes the file full: wait...
050401  0:45:06  InnoDB: Log file /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data/ib_logfile1 did not ex
ist: new to be created
InnoDB: Setting log file /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/data/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
050401  0:45:08  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
he 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 = 31599 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=(nil)
Attemwhere mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xbfffc128, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x80a2643 handle_segfault + 423
0x8388d78 pthread_sighandler + 184
0x834c3d0 reinit_io_cache + 248
0x810f6f0 find_log_pos__9MYSQL_LOGP11st_log_infoPCcb + 328
0x8113c18 open__9MYSQL_LOGPCc + 304
0x80a3c22 init_server_components__Fv + 970
0x80a40c3 main + 647
0x8390e64 __libc_start_main + 212
0x8048101 _start + 33
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
pting backtrace. You can use the following information to find out
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.
050401 00:45:08  mysqld ended

################################################################3

With 
  skip-innodb
  skip-networking
It just correctly dies:

050401 00:55:08  mysqld started
^G/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/bin/mysqld: File '/home/gleb/mysqls/logs/log_j/log_j.index'
 not found (Errcode: 2)
^G/home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/bin/mysqld: File '/home/gleb/mysqls/logs/log_j/log_j.1' not
 found (Errcode: 2)
050401  0:55:09 [ERROR] Could not use /home/gleb/mysqls/logs/log_j/log_j for logging (error 2). Turning logging off for
the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restar
t it.
050401  0:55:09 [ERROR] Aborting

050401  0:55:09 [Note] /home/gleb/mysqls/mysql-debug-5.0.3-beta-pc-linux-gnu-i686/bin/mysqld: Shutdown complete

050401 00:55:09  mysqld ended

Suggested fix:
MySQL shouldn't die with SIG 11 in case of wrong configuration. It should just leave an error message.
[22 Apr 2005 22:05] 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/24241
[22 Apr 2005 22:08] Guilhem Bichot
Thank you for your bug report!! Now fixed in 5.0.5. 
ChangeSet@1.1879, 2005-04-23 00:05:05+02:00, gbichot@quadita2.mysql.com
[25 Apr 2005 16:11] Paul DuBois
Noted in 5.0.5 changelog.