Bug #76604 Assertion `length > 0 && keyparts != 0' failed in create_ref_for_key
Submitted: 7 Apr 2015 4:29 Modified: 7 Apr 2015 6:11
Reporter: Ramesh Sivaraman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:5.6.23, 5.6.24, 5.6.25, 5.7.8 OS:Linux (CentOS 7)
Assigned to: CPU Architecture:Any
Tags: debug

[7 Apr 2015 4:29] Ramesh Sivaraman
Description:
#0  0x00007fe7a6e2b771 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000000a9804e in my_write_core (sig=6) at /sda/build/mysql-5.6.23/mysys/stacktrace.c:422
#2  0x00000000007277f0 in handle_fatal_signal (sig=6) at /sda/build/mysql-5.6.23/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007fe7a5c375d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007fe7a5c38cc8 in __GI_abort () at abort.c:90
#6  0x00007fe7a5c30546 in __assert_fail_base (fmt=0x7fe7a5d80128 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xf0e560 "length > 0 && keyparts != 0", file=file@entry=0xf0e2c0 "/sda/build/mysql-5.6.23/sql/sql_select.cc", line=line@entry=1654, function=function@entry=0xf0f580 <create_ref_for_key(JOIN*, st_join_table*, Key_use*, unsigned long long)::__PRETTY_FUNCTION__> "bool create_ref_for_key(JOIN*, JOIN_TAB*, Key_use*, table_map)") at assert.c:92
#7  0x00007fe7a5c305f2 in __GI___assert_fail (assertion=0xf0e560 "length > 0 && keyparts != 0", file=0xf0e2c0 "/sda/build/mysql-5.6.23/sql/sql_select.cc", line=1654, function=0xf0f580 <create_ref_for_key(JOIN*, st_join_table*, Key_use*, unsigned long long)::__PRETTY_FUNCTION__> "bool create_ref_for_key(JOIN*, JOIN_TAB*, Key_use*, table_map)") at assert.c:101
#8  0x0000000000803b4f in create_ref_for_key (join=0x7fe78907d658, j=0x7fe78914f508, org_keyuse=0x7fe789150570, used_tables=13835058055282163717) at /sda/build/mysql-5.6.23/sql/sql_select.cc:1654
#9  0x00000000008037a5 in JOIN::set_access_methods (this=0x7fe78907d658) at /sda/build/mysql-5.6.23/sql/sql_select.cc:1519
#10 0x00000000009a4731 in JOIN::optimize (this=0x7fe78907d658) at /sda/build/mysql-5.6.23/sql/sql_optimizer.cc:475
#11 0x0000000000802752 in mysql_execute_select (thd=0x7fe7967ee000, select_lex=0x7fe7967f0878, free_join=true) at /sda/build/mysql-5.6.23/sql/sql_select.cc:1086
#12 0x0000000000802aa3 in mysql_select (thd=0x7fe7967ee000, tables=0x7fe78901f3e0, wild_num=1, fields=..., conds=0x7fe789020bf8, order=0x7fe7967f0a40, group=0x7fe7967f0978, having=0x0, select_options=2147748612, result=0x7fe789020e40, unit=0x7fe7967f0230, select_lex=0x7fe7967f0878) at /sda/build/mysql-5.6.23/sql/sql_select.cc:1221
#13 0x00000000009400f9 in mysql_explain_unit (thd=0x7fe7967ee000, unit=0x7fe7967f0230, result=0x7fe789020e40) at /sda/build/mysql-5.6.23/sql/opt_explain.cc:2132
#14 0x000000000093fccf in explain_query_expression (thd=0x7fe7967ee000, result=0x7fe789020e40) at /sda/build/mysql-5.6.23/sql/opt_explain.cc:2034
#15 0x00000000007da87a in execute_sqlcom_select (thd=0x7fe7967ee000, all_tables=0x7fe78901f3e0) at /sda/build/mysql-5.6.23/sql/sql_parse.cc:5088
#16 0x00000000007d3730 in mysql_execute_command (thd=0x7fe7967ee000) at /sda/build/mysql-5.6.23/sql/sql_parse.cc:2649
#17 0x00000000007dd54a in mysql_parse (thd=0x7fe7967ee000, rawbuf=0x7fe78901f010 "EXPLAIN SELECT * FROM t1 WHERE a IN(SELECT a AS f1 FROM t1 GROUP BY f1)", length=71, parser_state=0x7fe7a73e2e70) at /sda/build/mysql-5.6.23/sql/sql_parse.cc:6357
#18 0x00000000007d06bc in dispatch_command (command=COM_QUERY, thd=0x7fe7967ee000, packet=0x7fe78fbe1001 "", packet_length=71) at /sda/build/mysql-5.6.23/sql/sql_parse.cc:1332
#19 0x00000000007cf7ab in do_command (thd=0x7fe7967ee000) at /sda/build/mysql-5.6.23/sql/sql_parse.cc:1034
#20 0x0000000000797b3d in do_handle_one_connection (thd_arg=0x7fe7967ee000) at /sda/build/mysql-5.6.23/sql/sql_connect.cc:982
#21 0x0000000000797626 in handle_one_connection (arg=0x7fe7967ee000) at /sda/build/mysql-5.6.23/sql/sql_connect.cc:898
#22 0x0000000000b5d798 in pfs_spawn_thread (arg=0x7fe7a17fe600) at /sda/build/mysql-5.6.23/storage/perfschema/pfs.cc:1860
#23 0x00007fe7a6e26df5 in start_thread (arg=0x7fe7a73e4700) at pthread_create.c:308
#24 0x00007fe7a5cf81ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1(a CHAR(0)NOT NULL);
INSERT INTO t1 VALUES(0xAEDD);
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(),(),();
EXPLAIN SELECT * FROM t1 WHERE a IN(SELECT a AS f1 FROM t1 GROUP BY f1);

The attached tarball gives the testcase as an exact match of our system,
including some handy utilities

$ vi {epoch}_mybase # Update base path in this file (the only change
required!). For non-binary distribution please update SOURCE_DIR
location also.
$ ./{epoch}_init # Initializes the data dir
$ ./{epoch}_start # Starts mysqld
$ ./{epoch}_cl # To check mysqld is up
$ ./{epoch}_run # Run the testcase with pquery binary(produces
output)
$ vi /dev/shm/{epoch}/error.log.out # Verify the error log
$ ./{epoch}_gdb # Brings you to a gdb prompt attached to correct
mysqld
& generated core
$ ./{epoch}_parse_core # Create {epoch}_STD.gdb and {epoch}_FULL.gdb;
standard and full var gdb stack traces
etc.
[7 Apr 2015 4:30] Ramesh Sivaraman
Testcase bundle

Attachment: 1428375396_bug_bundle.tar.gz (application/gzip, text), 998.09 KiB.

[7 Apr 2015 6:11] MySQL Verification Team
Hello Ramesh Sivaraman,

Thank you for the report and test case.
Observed that 5.6.24, 5.6.25 and 5.7.8 debug builds are affected.

Thanks,
Umesh
[7 Apr 2015 6:11] MySQL Verification Team
// 5.6.24 - only debug build affected

scripts/mysql_install_db --basedir=/export/umesh/server/binaries/mysql-5.6.24 --datadir=/export/umesh/server/binaries/mysql-5.6.24/76604
bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-5.6.24 --datadir=/export/umesh/server/binaries/mysql-5.6.24/76604 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.6.24/76604/log.err 2>&1 &

commit: 97543660999308893335d81b92307c389e6821a5
date: 2015-03-25 17:22:45 +0100
build-date: 2015-03-25 17:26:48 +0100
short: 9754366
branch: mysql-5.6.24-release

MySQL source 5.6.24

(gdb) bt
#0  0x00007f3f1006e771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000ae0f7f in my_write_core (sig=6) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/mysys/stacktrace.c:422
#2  0x0000000000745f8a in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f3f0ec745c9 in raise () from /lib64/libc.so.6
#5  0x00007f3f0ec75cd8 in abort () from /lib64/libc.so.6
#6  0x00007f3f0ec6d536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f3f0ec6d5e2 in __assert_fail () from /lib64/libc.so.6
#8  0x000000000082fb99 in create_ref_for_key (join=0x7f3ebc0189f8, j=0x7f3ebc01b898, org_keyuse=0x7f3ebc01d700, used_tables=13835058055282163717)
    at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_select.cc:1654
#9  0x0000000000831b90 in JOIN::set_access_methods (this=0x7f3ebc0189f8) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_select.cc:1519
#10 0x00000000009f5303 in JOIN::optimize (this=0x7f3ebc0189f8) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_optimizer.cc:475
#11 0x0000000000832c64 in mysql_execute_select (thd=0x3fbde20, select_lex=0x3fc02e0, free_join=true)
    at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_select.cc:1086
#12 0x000000000083366b in mysql_select (thd=0x3fbde20, tables=0x7f3ebc0053a0, wild_num=1, fields=..., conds=0x7f3ebc006bb8, order=0x3fc04a8, group=0x3fc03e0, having=0x0,
    select_options=2147748612, result=0x7f3ebc006e00, unit=0x3fbfc98, select_lex=0x3fc02e0) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_select.cc:1221
#13 0x000000000096ecd2 in mysql_explain_unit (thd=0x3fbde20, unit=0x3fbfc98, result=0x7f3ebc006e00)
    at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/opt_explain.cc:2132
#14 0x000000000096edaa in explain_query_expression (thd=0x3fbde20, result=0x7f3ebc006e00) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/opt_explain.cc:2035
#15 0x00000000007f9556 in execute_sqlcom_select (thd=0x3fbde20, all_tables=0x7f3ebc0053a0) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_parse.cc:5124
#16 0x00000000007fac07 in mysql_execute_command (thd=0x3fbde20) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_parse.cc:2661
#17 0x0000000000802212 in mysql_parse (thd=0x3fbde20, rawbuf=0x7f3ebc004fd0 "EXPLAIN SELECT * FROM t1 WHERE a IN(SELECT a AS f1 FROM t1 GROUP BY f1)", length=71, parser_state=0x7f3ee5925700)
    at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_parse.cc:6391
#18 0x0000000000803e36 in dispatch_command (command=COM_QUERY, thd=0x3fbde20, packet=0x40ecd81 "", packet_length=71)
    at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_parse.cc:1340
#19 0x00000000008056c0 in do_command (thd=0x3fbde20) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_parse.cc:1037
#20 0x00000000007bb221 in do_handle_one_connection (thd_arg=0x3fbde20) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_connect.cc:982
#21 0x00000000007bb2e7 in handle_one_connection (arg=0x3fbde20) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/sql/sql_connect.cc:898
#22 0x0000000000dd43e0 in pfs_spawn_thread (arg=0x40656f0) at /export/home/pb2/build/sb_0-14808650-1427301633.73/mysqlcom-pro-5.6.24/storage/perfschema/pfs.cc:1860
#23 0x00007f3f10069df3 in start_thread () from /lib64/libpthread.so.0
#24 0x00007f3f0ed3547d in clone () from /lib64/libc.so.6
[7 Apr 2015 6:11] MySQL Verification Team
// 5.6.25  - only debug build affected

scripts/mysql_install_db --basedir=/export/umesh/server/binaries/mysql-5.6.25 --datadir=/export/umesh/server/binaries/mysql-5.6.25/76604
bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-5.6.25 --datadir=/export/umesh/server/binaries/mysql-5.6.25/76604 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.6.25/76604/log.err 2>&1 &

commit: a322a3cf5881a77b2fe55a531a18f0bd4c19dabc
date: 2015-04-06 14:32:57 +0530
build-date: 2015-04-06 11:26:23 +0200
short: a322a3c
branch: mysql-5.6

MySQL source 5.6.25

(gdb) bt
#0  0x00007f4c91b84771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000ae1513 in my_write_core (sig=6) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/mysys/stacktrace.c:422
#2  0x000000000074600a in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f4c9078a5c9 in raise () from /lib64/libc.so.6
#5  0x00007f4c9078bcd8 in abort () from /lib64/libc.so.6
#6  0x00007f4c90783536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f4c907835e2 in __assert_fail () from /lib64/libc.so.6
#8  0x000000000082fdd1 in create_ref_for_key (join=0x7f4c3c0189f8, j=0x7f4c3c01b898, org_keyuse=0x7f4c3c01d700, used_tables=13835058055282163717)
    at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_select.cc:1654
#9  0x0000000000831dc8 in JOIN::set_access_methods (this=0x7f4c3c0189f8) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_select.cc:1519
#10 0x00000000009f5669 in JOIN::optimize (this=0x7f4c3c0189f8) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_optimizer.cc:475
#11 0x0000000000832e9c in mysql_execute_select (thd=0x28268e0, select_lex=0x2828da0, free_join=true)
    at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_select.cc:1086
#12 0x00000000008338a3 in mysql_select (thd=0x28268e0, tables=0x7f4c3c0053a0, wild_num=1, fields=..., conds=0x7f4c3c006bb8, order=0x2828f68, group=0x2828ea0, having=0x0,
    select_options=2147748612, result=0x7f4c3c006e00, unit=0x2828758, select_lex=0x2828da0) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_select.cc:1221
#13 0x000000000096efe6 in mysql_explain_unit (thd=0x28268e0, unit=0x2828758, result=0x7f4c3c006e00)
    at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/opt_explain.cc:2132
#14 0x000000000096f0be in explain_query_expression (thd=0x28268e0, result=0x7f4c3c006e00) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/opt_explain.cc:2035
#15 0x00000000007f978a in execute_sqlcom_select (thd=0x28268e0, all_tables=0x7f4c3c0053a0) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_parse.cc:5119
#16 0x00000000007fae3b in mysql_execute_command (thd=0x28268e0) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_parse.cc:2656
#17 0x0000000000802446 in mysql_parse (thd=0x28268e0, rawbuf=0x7f4c3c004fd0 "EXPLAIN SELECT * FROM t1 WHERE a IN(SELECT a AS f1 FROM t1 GROUP BY f1)", length=71, parser_state=0x7f4c6743b700)
    at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_parse.cc:6386
#18 0x000000000080406a in dispatch_command (command=COM_QUERY, thd=0x28268e0, packet=0x2955071 "", packet_length=71)
    at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_parse.cc:1340
#19 0x00000000008058f6 in do_command (thd=0x28268e0) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_parse.cc:1037
#20 0x00000000007bb329 in do_handle_one_connection (thd_arg=0x28268e0) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_connect.cc:982
#21 0x00000000007bb3ef in handle_one_connection (arg=0x28268e0) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/sql/sql_connect.cc:898
#22 0x0000000000dd49cc in pfs_spawn_thread (arg=0x2936de0) at /export/home/pb2/build/sb_0-14909455-1428315097.54/mysqlcom-pro-5.6.25/storage/perfschema/pfs.cc:1860
#23 0x00007f4c91b7fdf3 in start_thread () from /lib64/libpthread.so.0
#24 0x00007f4c9084b47d in clone () from /lib64/libc.so.6
[7 Apr 2015 6:11] MySQL Verification Team
// 5.7.8 - only debug builds affected

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-5.7.8 --datadir=/export/umesh/server/binaries/mysql-5.7.8/76604 -v
bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-5.7.8 --datadir=/export/umesh/server/binaries/mysql-5.7.8/76604 --sql_mode=ONLY_FULL_GROUP_BY --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.7.8/76604/log.err 2>&1 &

- build

commit: e0e83d66a46ace298c5aeb610eeb09d3265877b9
date: 2015-04-06 14:33:46 +0530
build-date: 2015-04-06 18:01:30 +0200
short: e0e83d6
branch: mysql-5.7

MySQL source 5.7.8

(gdb) bt
#0  0x00007fab58d66771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000018caf38 in my_write_core (sig=6) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/mysys/stacktrace.c:247
#2  0x0000000000f4e15a in handle_fatal_signal (sig=6) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007fab5796c5c9 in raise () from /lib64/libc.so.6
#5  0x00007fab5796dcd8 in abort () from /lib64/libc.so.6
#6  0x00007fab57965536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007fab579655e2 in __assert_fail () from /lib64/libc.so.6
#8  0x00000000016158d9 in calc_length_and_keyparts (keyuse=0x7faad4031d18, tab=0x7faad40499e8, key=0, used_tables=13835058055282163717, chosen_keyuses=0x7fab4d58d5b0,
    length_out=0x7fab4d58d630, keyparts_out=0x7fab4d58d634, dep_map=0x0, maybe_null=0x0) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_select.cc:1196
#9  0x0000000001615a54 in create_ref_for_key (join=0x7faad4049ab0, j=0x7faad40499e8, org_keyuse=0x7faad4031cb0, used_tables=13835058055282163717)
    at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_select.cc:1254
#10 0x00000000016154df in JOIN::init_ref_access (this=0x7faad4049ab0) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_select.cc:1093
#11 0x00000000015a099a in JOIN::optimize (this=0x7faad4049ab0) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_optimizer.cc:445
#12 0x00000000016150c6 in st_select_lex::optimize (this=0x7faad4005380, thd=0x7faad4000bb0) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_select.cc:1003
#13 0x00000000016137e5 in handle_query (thd=0x7faad4000bb0, lex=0x7faad4002b60, result=0x7faad40489b0, added_options=0, removed_options=0)
    at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_select.cc:163
#14 0x00000000015ca4e0 in execute_sqlcom_select (thd=0x7faad4000bb0, all_tables=0x7faad4006908)
    at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:4767
#15 0x00000000015c3fa1 in mysql_execute_command (thd=0x7faad4000bb0) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:2468
#16 0x00000000015cb5dd in mysql_parse (thd=0x7faad4000bb0, parser_state=0x7fab4d58ee50) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:5206
#17 0x00000000015c1162 in dispatch_command (thd=0x7faad4000bb0, com_data=0x7fab4d58fe00, command=COM_QUERY)
    at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:1280
#18 0x00000000015bfdb5 in do_command (thd=0x7faad4000bb0) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:851
#19 0x00000000016e48b2 in handle_connection (arg=0x4282b60) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/conn_handler/connection_handler_per_thread.cc:299
#20 0x00000000019814a5 in pfs_spawn_thread (arg=0x41a3b90) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/storage/perfschema/pfs.cc:2147
#21 0x00007fab58d61df3 in start_thread () from /lib64/libpthread.so.0
#22 0x00007fab57a2d47d in clone () from /lib64/libc.so.6
(gdb)
[7 Apr 2015 6:14] MySQL Verification Team
// 5.8.0 - debug build affected ( may need to set sql_mode='')

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-5.8.0 --datadir=/export/umesh/server/binaries/mysql-5.8.0/76604 -v
bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-5.8.0 --datadir=/export/umesh/server/binaries/mysql-5.8.0/76604 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.8.0/76604/log.err 2>&1 &

commit: de85b97c7655188ff48d28cdd016a3768c2f574e
date: 2015-04-06 14:34:26 +0530
build-date: 2015-04-06 17:06:40 +0200
short: de85b97
branch: mysql-trunk

MySQL source 5.8.0

(gdb) bt
#0  0x00007f4a82a25771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000018b09d4 in my_write_core (sig=6) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/mysys/stacktrace.c:247
#2  0x0000000000f40b8f in handle_fatal_signal (sig=6) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/signal_handler.cc:221
#3  <signal handler called>
#4  0x00007f4a8162b5c9 in raise () from /lib64/libc.so.6
#5  0x00007f4a8162ccd8 in abort () from /lib64/libc.so.6
#6  0x00007f4a81624536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f4a816245e2 in __assert_fail () from /lib64/libc.so.6
#8  0x00000000015fba9b in calc_length_and_keyparts (keyuse=0x7f49f404cfa8, tab=0x7f49f40499d8, key=0, used_tables=13835058055282163717, chosen_keyuses=0x7f4a7824d5b0,
    length_out=0x7f4a7824d630, keyparts_out=0x7f4a7824d634, dep_map=0x0, maybe_null=0x0) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_select.cc:1201
#9  0x00000000015fbc16 in create_ref_for_key (join=0x7f49f4049aa0, j=0x7f49f40499d8, org_keyuse=0x7f49f404cf40, used_tables=13835058055282163717)
    at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_select.cc:1259
#10 0x00000000015fb6a1 in JOIN::init_ref_access (this=0x7f49f4049aa0) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_select.cc:1098
#11 0x00000000015879f9 in JOIN::optimize (this=0x7f49f4049aa0) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_optimizer.cc:449
#12 0x00000000015fb288 in st_select_lex::optimize (this=0x7f49f4005380, thd=0x7f49f4000bb0) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_select.cc:1008
#13 0x00000000015f99b5 in handle_query (thd=0x7f49f4000bb0, lex=0x7f49f4002b60, result=0x7f49f40489a0, added_options=0, removed_options=0)
    at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_select.cc:168
#14 0x00000000015b0a76 in execute_sqlcom_select (thd=0x7f49f4000bb0, all_tables=0x7f49f4006908)
    at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:4723
#15 0x00000000015aa66a in mysql_execute_command (thd=0x7f49f4000bb0) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:2439
#16 0x00000000015b1b61 in mysql_parse (thd=0x7f49f4000bb0, parser_state=0x7f4a7824ee50) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:5165
#17 0x00000000015a7888 in dispatch_command (thd=0x7f49f4000bb0, com_data=0x7f4a7824fe00, command=COM_QUERY)
    at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:1247
#18 0x00000000015a64f3 in do_command (thd=0x7f49f4000bb0) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:816
#19 0x00000000016cab86 in handle_connection (arg=0x4e5f140) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/sql/conn_handler/connection_handler_per_thread.cc:300
#20 0x00000000018ea93d in pfs_spawn_thread (arg=0x4d806b0) at /export/home3/pb2/build/sb_0-14912630-1428334233.61/mysqlcom-pro-5.8.0-m17/storage/perfschema/pfs.cc:2147
#21 0x00007f4a82a20df3 in start_thread () from /lib64/libpthread.so.0
#22 0x00007f4a816ec47d in clone () from /lib64/libc.so.6
(gdb)