Bug #16626 SELECT on information_schema causes the server to crash
Submitted: 19 Jan 2006 9:59 Modified: 23 Jan 2006 9:35
Reporter: Karl Nyberg Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.18-standard-log OS:Linux (RHEL4 WS x86)
Assigned to: CPU Architecture:Any

[19 Jan 2006 9:59] Karl Nyberg
Description:
Running on a Pentium IV PC with 1Gb of RAM and plenty of free disk space

The following MySQL provided RPM's are installed:
MySQL-client-standard-5.0.18-0.rhel4.i386.rpm
MySQL-devel-standard-5.0.18-0.rhel4.i386.rpm
MySQL-server-standard-5.0.18-0.rhel4.i386.rpm
MySQL-shared-standard-5.0.18-0.rhel4.i386.rpm

Doing select on the following tables in the information_schema causes the server to crash.

COLUMNS
KEY_COLUMN_USAGE
STATISTICS
TABLE_CONSTRAINTS
TABLES
TRIGGERS
VIEWS

The client message is the following
ERROR 2013 (HY000): Lost connection to MySQL server during query

All other selects works just fine.

From the error log:

Version: '5.0.18-standard-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306
 MySQL Community Edition - Standard (GPL)
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=268435456
read_buffer_size=1044480
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 = 466543 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x8a8b260
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=0x30fffc, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x8158d70
Stack trace seems successful - bottom reached
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 0x8aaa748 = select * from tables limit 10
thd->thread_id=2
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.

Number of processes running now: 0
060119 10:41:59  mysqld restarted
InnoDB: Error: log file /var/lib/mysql/iblogs/ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!
060119 10:42:00 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.18-standard-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306

How to repeat:
Repeats every time you run the select on this setup

Suggested fix:
No idea.
[19 Jan 2006 10:36] Karl Nyberg
Problem was isolated to the errorneous size of the innoDB log file

From the previous error log (message on server startup):

InnoDB: Error: log file /var/lib/mysql/iblogs/ib_logfile0 is of different size 0
5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!

The problem occured when switching to a new .cnf file where the innoDB log size setting was altered from the vanilla startup settings.
After removing the old log files (this is a test system) and restarting the server everything seems to work fine.

I would still consider this a bug even though it was caused by a faulty setting.
[21 Jan 2006 11:12] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I was not able to repeat the problem with latest 5.0.19-BK on Fedora Core.

I intentionally started server with incorrect log size:

[openxs@Fedora 5.0]$ bin/mysqld_safe --innodb_log_file_size=52428800 &

and got the same message upon startup:

060121 13:48:33  mysqld started
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 52428800 bytes!
060121 13:48:34 [Note] /home/openxs/dbs/5.0/libexec/mysqld: ready for connections.

Then I tried SELECT * (and SELECT COUNT(*)) from all the tables you mentioned, and got correct results, but plenty of error messages in the error log like:

Version: '5.0.19'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
060121 13:49:07 [ERROR] /home/openxs/dbs/5.0/libexec/mysqld: Incorrect information in file: './test/comp2drugs.frm'
060121 13:49:07 [ERROR] /home/openxs/dbs/5.0/libexec/mysqld: Incorrect information in file: './test/comp2drugs.frm'
060121 13:49:07 [ERROR] /home/openxs/dbs/5.0/libexec/mysqld: Incorrect information in file: './test/compounds.frm'
...

But no crash.
[23 Jan 2006 9:35] Karl Nyberg
Hi Valeriy,

I have been able to repeat the behaviour when doing as you did so the problem still remains on my installation. Good thing if the problem is gone in 5.0.19 on Fedora and I will check if upgrading solves the issue when 5.0.19 for RedHat goes public and otherwise I will resend the bug.
Still, if the error messages that you get are reflecting errorneous information in the information_schema this might still pose a problem for people like me who have stopped parsing the SHOW CREATE statements for metadata.
Errorneous size of the logfile could possibly be considered a killer for the startup script to avoid pointer exceptions?

Best regards, Karl