Bug #70816 mysql crash
Submitted: 5 Nov 2013 6:24 Modified: 6 Dec 2013 5:59
Reporter: qinglin zhang (OCA) Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S2 (Serious)
Version:5.1.61 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysql query_cache

[5 Nov 2013 6:24] qinglin zhang
Description:
HI.
  One of our instance crashed when use query cache feature, the details goes like this:
first:
stack_bottom = 2af2fb7e3e58 thread_stack 0x40000
/u01/mysql/libexec/mysqld(my_print_stacktrace+0x29) [0x899769]
/u01/mysql/libexec/mysqld(handle_fatal_signal+0x41a) [0x6e803a]
/lib64/libpthread.so.0() [0x397f20f4a0]
/u01/mysql/libexec/mysqld(my_hash_insert+0x3cb) [0x88f44b]
/u01/mysql/libexec/mysqld(Query_cache::insert_table(unsigned int, char*, Query_cache_block_table*, unsigned int, unsigned char, char (*)(THD*, char*, unsigned int, unsigned long long*), unsigned long long)+0x16a) [0x71c3ea]
/u01/mysql/libexec/mysqld() [0x71c8e1]
/u01/mysql/libexec/mysqld(Query_cache::register_all_tables(Query_cache_block*, TABLE_LIST*, unsigned int)+0x13) [0x71ca73]
/u01/mysql/libexec/mysqld(Query_cache::store_query(THD*, TABLE_LIST*)+0x4d8) [0x71ec88]
/u01/mysql/libexec/mysqld() [0x5f8545]
/u01/mysql/libexec/mysqld(mysql_execute_command(THD*)+0x4d6) [0x5fc126]
/u01/mysql/libexec/mysqld(mysql_parse(THD*, char*, unsigned int, char const**)+0x3e2) [0x601682]
/u01/mysql/libexec/mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0xb79) [0x602219]
/u01/mysql/libexec/mysqld(do_command(THD*)+0x112) [0x602fd2]
/u01/mysql/libexec/mysqld(handle_one_connection+0x21d) [0x5f51ed]
/lib64/libpthread.so.0() [0x397f2077f1]
/lib64/libc.so.6(clone+0x6d) [0x397eee570d]

second:
Query (59c2010): SELECT ff.*, f.* FROM prex2_forum_forum f LEFT JOIN prex2_forum_forumfield ff ON ff.fid=f.fid WHERE f.fid=3
--
stack_bottom = 2b5b69a29e58 thread_stack 0x40000
/u01/mysql/libexec/mysqld(my_print_stacktrace+0x29) [0x899769]
/u01/mysql/libexec/mysqld(handle_fatal_signal+0x41a) [0x6e803a]
/lib64/libpthread.so.0() [0x397f20f4a0]
/u01/mysql/libexec/mysqld(Query_cache::free_query_internal(Query_cache_block*)+0xe9) [0x71a7a9]
/u01/mysql/libexec/mysqld() [0x71b9fb]
/u01/mysql/libexec/mysqld(query_cache_insert(st_net*, char const*, unsigned long)+0x37b) [0x71e72b]
/u01/mysql/libexec/mysqld(net_real_write+0x3e) [0x5dff7e]
/u01/mysql/libexec/mysqld(net_flush+0x1b) [0x5e03fb]rdsuvmmfzyq7nf3 
/u01/mysql/libexec/mysqld(net_end_statement(THD*)+0x1a8) [0x5e2448]
/u01/mysql/libexec/mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0x188) [0x601828]
/u01/mysql/libexec/mysqld(do_command(THD*)+0x112) [0x602fd2]
/u01/mysql/libexec/mysqld(handle_one_connection+0x21d) [0x5f51ed]
/lib64/libpthread.so.0() [0x397f2077f1]
/lib64/libc.so.6(clone+0x6d) [0x397eee570d]

How to repeat:
can't repeat yet

Suggested fix:
none
[5 Nov 2013 7:35] MySQL Verification Team
Hi!

Please upgrade to the newest version, such as 5.1.74, 5.5.34, 5.6.14.
There was a race condition in the query cache that has been fixed since 5.1.61.
It could be responsible for this..

Noted in 5.1.68, 5.5.30, 5.6.11, 5.7.1 changelogs.

"Enabling the query cache during high client contention could cause the server to exit. (Bug #14727815)"
[6 Nov 2013 2:43] qinglin zhang
HI. 
   I have read all the change log of new version of mysql , nothing find, so what should I do if I can't upgrade?
[6 Nov 2013 5:59] MySQL Verification Team
You must upgrade to eliminate the possibility of a race condition in query cache.
If you don't want to or cannot upgrade, then you should disable query cache to avoid crash:

[mysqld]
query-cache-type=0
query-cache-size=0
[7 Dec 2013 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".