Bug #59919 Crash in TMP_TABLE_PARAM::init() with semijoin=on
Submitted: 3 Feb 2011 10:49 Modified: 21 Apr 2011 1:00
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S1 (Critical)
Version:5.6.2-m5 (mysql-next-mr-opt-backpointing) OS:Any
Assigned to: CPU Architecture:Any
Tags: optimizer_switch, semijoin, subquery

[3 Feb 2011 10:49] Roel Van de Paar
Description:
110203 11:31:29 - 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=8388608
read_buffer_size=131072
max_used_connections=1
max_threads=151
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 = 338616 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x336b210
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 = 0x7f896352e0c8 thread_stack 0x40000
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(my_print_stacktrace+0x32)[0x92dec7]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(handle_segfault+0x31d)[0x56fbda]
/lib/libpthread.so.0[0x7f8975903080]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_ZN15TMP_TABLE_PARAM4initEv+0x52)[0x5c8b2e]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_Z24setup_sj_materializationP13st_join_table+0x93)[0x63d6f0]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld[0x649dbe]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_ZN4JOIN8optimizeEv+0x1ff6)[0x64ec60]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13selec
t_resultP18st_select_lex_unitP13st_select_lex+0x2ff)[0x652414]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x1d1)[0x658233]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld[0x5f99bb]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_Z21mysql_execute_commandP3THD+0x92d)[0x5fbdc7]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x1e3)[0x602d69]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xabb)[0x603922]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_Z10do_commandP3THD+0x26c)[0x604f0e]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x470)[0x6d65a1]
/data0/rvandepaar/mysql-5.6.2-m5-linux-x86_64-normal/bin/mysqld(handle_one_connection+0x2d)[0x6d669a]
/lib/libpthread.so.0[0x7f89758fb3ba]
/lib/libc.so.6(clone+0x6d)[0x7f8974b9d02d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x33b8370): SELECT * FROM B WHERE f2 IN (SELECT A.f1 FROM (A LEFT OUTER JOIN ((B AS b1 JOIN B AS b2 ON (1=1))) ON (1=1)))
Connection ID (thread ID): 1
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

How to repeat:
DROP DATABASE IF EXISTS test2; CREATE DATABASE test2; USE test2; /* test setup */

CREATE TABLE A (f1 int NOT NULL) ENGINE=MyISAM ;
CREATE TABLE B (f1 int NOT NULL,f2 int) ENGINE=MyISAM ;

INSERT INTO A VALUES (1);
INSERT INTO B VALUES (1,1);
INSERT INTO B VALUES (2,1);

SET @@SESSION.optimizer_switch="semijoin=off";

SELECT * FROM B WHERE f2 IN (SELECT A.f1 FROM (A LEFT OUTER JOIN ((B AS b1 JOIN B AS b2 ON (1=1))) ON (1=1))); /* works */

SET @@SESSION.optimizer_switch="semijoin=on";

SELECT * FROM B WHERE f2 IN (SELECT A.f1 FROM (A LEFT OUTER JOIN ((B AS b1 JOIN B AS b2 ON (1=1))) ON (1=1))); /* crashes */
[3 Feb 2011 10:53] Roel Van de Paar
Possibly related: bug #51489 | bug #46556 | (bug #57525) | (bug #43768)
[3 Feb 2011 10:59] Roel Van de Paar
Happens for MyISAM, MEMORY but not InnoDB.
[4 Feb 2011 9:41] MySQL Verification Team
.

Attachment: bug59919_gdb_info.txt (text/plain), 4.18 KiB.

[25 Feb 2011 5:34] Roel Van de Paar
Also note bug #42742
[21 Apr 2011 1:00] Paul DuBois
Bug does not affect any released 5.6.x version. No changelog entry needed.