Bug #14941 A server crash in SHOW TABLES when there is an InnoDB table and --skip-innodb
Submitted: 15 Nov 2005 10:36 Modified: 15 Nov 2005 11:07
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 OS:
Assigned to: CPU Architecture:Any

[15 Nov 2005 10:36] Konstantin Osipov
Description:
The server crashes in SHOW TABLES (or in simple mysql command line connect, which issues SHOW TABLES internally), if a database contains an InnoDB table and --skip-innodb mysqld option has been specified.
The server is compiled with compile-pentium-valgrind-max and crashes due to ABORT signal.

How to repeat:
1. Start the server with InnoDB:

kostja@dragonfly:~/work/mysql-5.0-root/sql> ./mysqld     
051115 13:26:40 [Warning] setrlimit could not change the size of core files to 'infinity';  We may not be able to generate a core file on signals
051115 13:26:41  InnoDB: Started; log sequence number 0 61157630
051115 13:26:41 [Note] ./mysqld: ready for connections.
Version: '5.0.17-valgrind-max-debug'  socket: '/opt/local/var/mysql/mysql.sock'  port: 3307  Source distribution

2. Create an InnoDB table:

mysql> drop database test; create database test; create table t1 (a int) engine=                                   innodb;
Query OK, 4 rows affected (0.12 sec)

Query OK, 1 row affected (0.00 sec)

ERROR 1046 (3D000): No database selected
mysql> drop database test; create database test; use test; create table t1 (a in                                   t) engine=innodb;
Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.01 sec)

3. Restart the server with --skip-innodb:

051115 13:29:05 [Note] Got signal 15 to shutdown mysqld
051115 13:29:05 [Note] ./mysqld: Normal shutdown

051115 13:29:05  InnoDB: Starting shutdown...
051115 13:29:07  InnoDB: Shutdown completed; log sequence number 0 61183845
051115 13:29:07 [Note] ./mysqld: Shutdown complete

kostja@dragonfly:~/work/mysql-5.0-root/sql> ./mysqld --skip-innodb
051115 13:29:11 [Warning] setrlimit could not change the size of core files to 'infinity';  We may not be able to generate a core file on signals
051115 13:29:11 [Note] ./mysqld: ready for connections.
Version: '5.0.17-valgrind-max-debug'  socket: '/opt/local/var/mysql/mysql.sock'  port: 3307  Source distribution

4. Issue SHOW TABLES:

mysql> show tables;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1
Current database: test

Didn't find any fields in table 't1'
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/loc                                   al/var/mysql/mysql.sock' (111)
ERROR: 
Can't connect to the server

mysql> 

5. Observe the crash:

safe_mutex: Trying to lock unitialized mutex at ha_innodb.cc, line 6654
mysqld got signal 6;
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=8388600
read_buffer_size=131072
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 = 225791 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x8823620 = 
thd->thread_id=1
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.
Writing a core file
zsh: 19964 abort (core dumped)  ./mysqld --skip-innodb

Suggested fix:
The crux of the problem is printed here:

safe_mutex: Trying to lock unitialized mutex at ha_innodb.cc, line 6654
mysqld got signal 6;
[15 Nov 2005 11:07] Valeriy Kravchuk
Thank you for a bug report. I think, it is a duplicate of http://bugs.mysql.com/bug.php?id=14348 - yet another way to demonstrate the same problem.