I can reproduce the crash using the test case on PS 5.6.19 and PS 5.6.21, however, when I install jemalloc, no more crashing happens. So seems that using jemalloc may be a good enough workaround for now.
MySQL> DROP DATABASE test;CREATE DATABASE test;USE test;CREATE TABLE t1(a INT KEY,b TEXT)ENGINE=InnoDB;explain extended select * FROM t1 x,t1 y where(x.a=2 or (x.a,x.b)in ((0,0),(5,0),(4,3))) and y.a=x.a and y.b=x.b;
Query OK, 1 row affected (0.15 sec)
ERROR 2013 (HY000): Lost connection to MySQL server during query
Err log:
2014-12-02 11:47:39 10633 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.21-70.1' socket: '/var/lib/mysql/mysql.sock' port: 3306 Percona Server (GPL), Release 70.1, Revision 698
11:51:19 UTC - 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.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/
key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 69184 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x2c3dfa0
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...
stack_bottom = 7fcac40dfd40 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x2c)[0x8bdcec]
/usr/sbin/mysqld(handle_fatal_signal+0x461)[0x6512a1]
/lib64/libpthread.so.0(+0xf710)[0x7fcae304b710]
/lib64/libc.so.6(+0x89b78)[0x7fcae16feb78]
/lib64/libc.so.6(memmove+0x192)[0x7fcae16f8992]
/usr/sbin/mysqld(_ZN6String4copyERKS_+0x26)[0x716126]
/usr/sbin/mysqld(_ZN20cmp_item_sort_string11store_valueEP4Item+0x33)[0x5cdb43]
/usr/sbin/mysqld(_ZN12cmp_item_row11store_valueEP4Item+0x7c)[0x5c91ac]
/usr/sbin/mysqld(_ZN12Item_func_in18fix_length_and_decEv+0x8b4)[0x5c9c24]
/usr/sbin/mysqld(_ZN9Item_func10fix_fieldsEP3THDPP4Item+0x1f5)[0x5e6d75]
/usr/sbin/mysqld(_ZN12Item_func_in10fix_fieldsEP3THDPP4Item+0x13)[0x5bfbd3]
/usr/sbin/mysqld(_ZN9Item_cond10fix_fieldsEP3THDPP4Item+0x106)[0x5bf576]
/usr/sbin/mysqld(_ZN9Item_cond10fix_fieldsEP3THDPP4Item+0x106)[0x5bf576]
/usr/sbin/mysqld(_Z11setup_condsP3THDP10TABLE_LISTS2_PP4Item+0x10a)[0x68a63a]
/usr/sbin/mysqld(_ZN4JOIN7prepareEP10TABLE_LISTjP4ItemjP8st_orderS5_S3_P13st_select_lexP18st_select_lex_unit+0x4de)[0x6ed4be]
/usr/sbin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_P10SQL_I_ListI8st_orderESB_S7_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x89e)[0x6f6a2e]
/usr/sbin/mysqld[0x7c572d]
/usr/sbin/mysqld(_Z24explain_query_expressionP3THDP13select_result+0x67)[0x7ca617]
/usr/sbin/mysqld[0x55ae37]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x378f)[0x6d288f]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x5c8)[0x6d6168]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xfb7)[0x6d7887]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x162)[0x6a57f2]
/usr/sbin/mysqld(handle_one_connection+0x40)[0x6a58e0]
/usr/sbin/mysqld(pfs_spawn_thread+0x143)[0xac8523]
/lib64/libpthread.so.0(+0x79d1)[0x7fcae30439d1]
/lib64/libc.so.6(clone+0x6d)[0x7fcae175d9dd]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fca8c004f50): is an invalid pointer
Connection ID (thread ID): 1
Status: NOT_KILLED
[root@vagrant-centos65 ~]# yum install -y jemalloc.x86_64
[root@vagrant-centos65 ~]# /etc/init.d/mysql restart
Shutting down MySQL (Percona Server).. SUCCESS!
Starting MySQL (Percona Server)... SUCCESS!
[root@vagrant-centos65 ~]# lsof -p `pidof mysqld`|grep jema
mysqld 10907 mysql mem REG 8,1 210024 6961 /usr/lib64/libjemalloc.so.1
MySQL> DROP DATABASE test;CREATE DATABASE test;USE test;CREATE TABLE t1(a INT KEY,b TEXT)ENGINE=InnoDB;explain extended select * FROM t1 x,t1 y where(x.a=2 or (x.a,x.b)in ((0,0),(5,0),(4,3))) and y.a=x.a and y.b=x.b;
Query OK, 1 row affected (0.02 sec)
I can reproduce the crash using the test case on PS 5.6.19 and PS 5.6.21, however, when I install jemalloc, no more crashing happens. So seems that using jemalloc may be a good enough workaround for now.
[root@vagrant- centos65 ~]# rpm -qa|grep Percona-Server Server- shared- 56-5.6. 21-rel70. 1.el6.x86_ 64 Server- shared- 51-5.1. 73-rel14. 12.624. rhel6.x86_ 64 Server- client- 56-5.6. 21-rel70. 1.el6.x86_ 64 Server- server- 56-5.6. 21-rel70. 1.el6.x86_ 64
Percona-
Percona-
Percona-
Percona-
MySQL> DROP DATABASE test;CREATE DATABASE test;USE test;CREATE TABLE t1(a INT KEY,b TEXT)ENGINE= InnoDB; explain extended select * FROM t1 x,t1 y where(x.a=2 or (x.a,x.b)in ((0,0), (5,0),( 4,3))) and y.a=x.a and y.b=x.b;
Query OK, 1 row affected (0.15 sec)
Query OK, 1 row affected (0.00 sec)
Database changed
Query OK, 0 rows affected (0.35 sec)
ERROR 2013 (HY000): Lost connection to MySQL server during query
Err log: mysql/mysql. sock' port: 3306 Percona Server (GPL), Release 70.1, Revision 698 bugs.percona. com/
2014-12-02 11:47:39 10633 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.21-70.1' socket: '/var/lib/
11:51:19 UTC - 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.
Please help us make Percona Server better by reporting any
bugs at http://
key_buffer_ size=8388608 size=131072 connections= 1 size)*max_ threads = 69184 K bytes of memory
read_buffer_
max_used_
max_threads=153
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x2c3dfa0 mysqld( my_print_ stacktrace+ 0x2c)[0x8bdcec] mysqld( handle_ fatal_signal+ 0x461)[ 0x6512a1] libpthread. so.0(+0xf710) [0x7fcae304b710 ] libc.so. 6(+0x89b78) [0x7fcae16feb78 ] libc.so. 6(memmove+ 0x192)[ 0x7fcae16f8992] mysqld( _ZN6String4copy ERKS_+0x26) [0x716126] mysqld( _ZN20cmp_ item_sort_ string11store_ valueEP4Item+ 0x33)[0x5cdb43] mysqld( _ZN12cmp_ item_row11store _valueEP4Item+ 0x7c)[0x5c91ac] mysqld( _ZN12Item_ func_in18fix_ length_ and_decEv+ 0x8b4)[ 0x5c9c24] mysqld( _ZN9Item_ func10fix_ fieldsEP3THDPP4 Item+0x1f5) [0x5e6d75] mysqld( _ZN12Item_ func_in10fix_ fieldsEP3THDPP4 Item+0x13) [0x5bfbd3] mysqld( _ZN9Item_ cond10fix_ fieldsEP3THDPP4 Item+0x106) [0x5bf576] mysqld( _ZN9Item_ cond10fix_ fieldsEP3THDPP4 Item+0x106) [0x5bf576] mysqld( _Z11setup_ condsP3THDP10TA BLE_LISTS2_ PP4Item+ 0x10a)[ 0x68a63a] mysqld( _ZN4JOIN7prepar eEP10TABLE_ LISTjP4ItemjP8s t_orderS5_ S3_P13st_ select_ lexP18st_ select_ lex_unit+ 0x4de)[ 0x6ed4be] mysqld( _Z12mysql_ selectP3THDP10T ABLE_LISTjR4Lis tI4ItemEPS4_ P10SQL_ I_ListI8st_ orderESB_ S7_yP13select_ resultP18st_ select_ lex_unitP13st_ select_ lex+0x89e) [0x6f6a2e] mysqld[ 0x7c572d] mysqld( _Z24explain_ query_expressio nP3THDP13select _result+ 0x67)[0x7ca617] mysqld[ 0x55ae37] mysqld( _Z21mysql_ execute_ commandP3THD+ 0x378f) [0x6d288f] mysqld( _Z11mysql_ parseP3THDPcjP1 2Parser_ state+0x5c8) [0x6d6168] mysqld( _Z16dispatch_ command19enum_ server_ commandP3THDPcj +0xfb7) [0x6d7887] mysqld( _Z24do_ handle_ one_connectionP 3THD+0x162) [0x6a57f2] mysqld( handle_ one_connection+ 0x40)[0x6a58e0] mysqld( pfs_spawn_ thread+ 0x143)[ 0xac8523] libpthread. so.0(+0x79d1) [0x7fcae30439d1 ] libc.so. 6(clone+ 0x6d)[0x7fcae17 5d9dd]
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...
stack_bottom = 7fcac40dfd40 thread_stack 0x40000
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
/lib64/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fca8c004f50): is an invalid pointer
Connection ID (thread ID): 1
Status: NOT_KILLED
[root@vagrant- centos65 ~]# yum install -y jemalloc.x86_64 centos65 ~]# /etc/init.d/mysql restart
[root@vagrant-
Shutting down MySQL (Percona Server).. SUCCESS!
Starting MySQL (Percona Server)... SUCCESS!
[root@vagrant- centos65 ~]# lsof -p `pidof mysqld`|grep jema libjemalloc. so.1
mysqld 10907 mysql mem REG 8,1 210024 6961 /usr/lib64/
MySQL> DROP DATABASE test;CREATE DATABASE test;USE test;CREATE TABLE t1(a INT KEY,b TEXT)ENGINE= InnoDB; explain extended select * FROM t1 x,t1 y where(x.a=2 or (x.a,x.b)in ((0,0), (5,0),( 4,3))) and y.a=x.a and y.b=x.b;
Query OK, 1 row affected (0.02 sec)
Query OK, 1 row affected (0.00 sec)
Database changed
Query OK, 0 rows affected (0.44 sec)
+----+- ------- -----+- ------+ ------- -+----- ------- ---+--- ------+ ------- --+---- ------+ ------+ ------- ---+--- ------- ---+ ------- -----+- ------+ ------- -+----- ------- ---+--- ------+ ------- --+---- ------+ ------+ ------- ---+--- ------- ---+ ------- -----+- ------+ ------- -+----- ------- ---+--- ------+ ------- --+---- ------+ ------+ ------- ---+--- ------- ---+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-
| 1 | SIMPLE | x | ALL | PRIMARY | NULL | NULL | NULL | 1 | 100.00 | Using where |
| 1 | SIMPLE | y | eq_ref | PRIMARY | PRIMARY | 4 | test.x.a | 1 | 100.00 | Using where |
+----+-
2 rows in set, 1 warning (0.00 sec)
With jemalloc, I cannot reproduce the crash even in a 100 loop of the test case.