Bug #84076 Assertion `thd->is_error() || kill_errno' failed.
Submitted: 6 Dec 2016 10:06 Modified: 6 Dec 2016 13:50
Reporter: Roel Van de Paar Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.6.34 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug

[6 Dec 2016 10:06] Roel Van de Paar
Description:
Version: '5.6.34-debug'  socket: '/sda/MS081116-mysql-5.6.34-linux-x86_64-debug/socket.sock'  port: 11652  MySQL Community Server (GPL)
mysqld: /git/mysql-server_dbg/sql/filesort.cc:448: ha_rows filesort(THD*, TABLE*, Filesort*, bool, ha_rows*, ha_rows*): Assertion `thd->is_error() || kill_errno' failed.
09:28:09 UTC - mysqld got signal 6 ;

Core was generated by `/sda/MS081116-mysql-5.6.34-linux-x86_64-debug/bin/mysqld --no-defaults --core -'.
Program terminated with signal 6, Aborted.
#0  0x00007fdd51109741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
61        val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
#0  0x00007fdd51109741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000000a9c852 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:422
#2  0x000000000072c554 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007fdd4f6a85f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007fdd4f6a9ce8 in __GI_abort () at abort.c:90
#6  0x00007fdd4f6a1566 in __assert_fail_base (fmt=0x7fdd4f7f1ce8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xf0e4c1 "thd->is_error() || kill_errno",
    file=file@entry=0xf0e360 "/git/mysql-server_dbg/sql/filesort.cc", line=line@entry=448,
    function=function@entry=0xf0eba0 <filesort(THD*, TABLE*, Filesort*, bool, unsigned long long*, unsigned long long*)::__PRETTY_FUNCTION__> "ha_rows filesort(THD*, TABLE*, Filesort*, bool, ha_rows*, ha_rows*)") at assert.c:92
#7  0x00007fdd4f6a1612 in __GI___assert_fail (assertion=0xf0e4c1 "thd->is_error() || kill_errno", file=0xf0e360 "/git/mysql-server_dbg/sql/filesort.cc", line=448,
    function=0xf0eba0 <filesort(THD*, TABLE*, Filesort*, bool, unsigned long long*, unsigned long long*)::__PRETTY_FUNCTION__> "ha_rows filesort(THD*, TABLE*, Filesort*, bool, ha_rows*, ha_rows*)") at assert.c:101
#8  0x000000000091fce4 in filesort (thd=0x7fdd28787000, table=0x7fdd1c07d010, filesort=0x7fdd1c151f08, sort_positions=false, examined_rows=0x7fdd516fbfd8,
    found_rows=0x7fdd516fbfd0) at /git/mysql-server_dbg/sql/filesort.cc:448
#9  0x00000000007af17d in create_sort_index (thd=0x7fdd28787000, join=0x7fdd1c150b30, tab=0x7fdd1c151798) at /git/mysql-server_dbg/sql/sql_executor.cc:3346
#10 0x00000000007accf5 in st_join_table::sort_table (this=0x7fdd1c151798) at /git/mysql-server_dbg/sql/sql_executor.cc:2515
#11 0x00000000007ac7d2 in join_init_read_record (tab=0x7fdd1c151798) at /git/mysql-server_dbg/sql/sql_executor.cc:2389
#12 0x00000000007aa122 in sub_select (join=0x7fdd1c150b30, join_tab=0x7fdd1c151798, end_of_records=false) at /git/mysql-server_dbg/sql/sql_executor.cc:1259
#13 0x00000000007a9b22 in do_select (join=0x7fdd1c150b30) at /git/mysql-server_dbg/sql/sql_executor.cc:936
#14 0x00000000007a7ac1 in JOIN::exec (this=0x7fdd1c150b30) at /git/mysql-server_dbg/sql/sql_executor.cc:194
#15 0x0000000000807d4d in mysql_execute_select (thd=0x7fdd28787000, select_lex=0x7fdd287894d0, free_join=true) at /git/mysql-server_dbg/sql/sql_select.cc:1101
#16 0x000000000080803f in mysql_select (thd=0x7fdd28787000, tables=0x7fdd1c01f848, wild_num=0, fields=..., conds=0x0, order=0x7fdd28789698, group=0x7fdd287895d0, having=0x0,
    select_options=4026796800, result=0x7fdd1c1509f0, unit=0x7fdd28788e88, select_lex=0x7fdd287894d0) at /git/mysql-server_dbg/sql/sql_select.cc:1222
#17 0x0000000000806127 in handle_select (thd=0x7fdd28787000, result=0x7fdd1c1509f0, setup_tables_done_option=1073741824) at /git/mysql-server_dbg/sql/sql_select.cc:110
#18 0x00000000007db436 in mysql_execute_command (thd=0x7fdd28787000) at /git/mysql-server_dbg/sql/sql_parse.cc:3528
#19 0x00000000007e2d7e in mysql_parse (thd=0x7fdd28787000, rawbuf=0x7fdd1c01f010 "INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS",
    length=83, parser_state=0x7fdd516fd5a0) at /git/mysql-server_dbg/sql/sql_parse.cc:6385
#20 0x00000000007d5faf in dispatch_command (command=COM_QUERY, thd=0x7fdd28787000,
    packet=0x7fdd2876b001 "INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS", packet_length=83) at /git/mysql-server_dbg/sql/sql_parse.cc:1339
#21 0x00000000007d5016 in do_command (thd=0x7fdd28787000) at /git/mysql-server_dbg/sql/sql_parse.cc:1036
#22 0x000000000079c9a5 in do_handle_one_connection (thd_arg=0x7fdd28787000) at /git/mysql-server_dbg/sql/sql_connect.cc:982
#23 0x000000000079c48e in handle_one_connection (arg=0x7fdd28787000) at /git/mysql-server_dbg/sql/sql_connect.cc:898
#24 0x0000000000ae8ac9 in pfs_spawn_thread (arg=0x7fdd4d7f46a0) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:1860
#25 0x00007fdd51104dc5 in start_thread (arg=0x7fdd516fe700) at pthread_create.c:308
#26 0x00007fdd4f769ced 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 tm1(a INT,b INT,KEY(a)) ENGINE=MERGE UNION=(t1);
create table t1(a double)partition by key (a);
set sql_mode='traditional';
INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS;

Perhaps connected with bug 74493. If the same bug, please backport fix to 5.6 also.
[6 Dec 2016 13:50] MySQL Verification Team
Thank you for the bug report.

2016-12-06 11:42:42 8696 [Note] c:\dbs\5.6\bin\mysqld: ready for connections.
Version: '5.6.36-debug'  socket: ''  port: 3560  Source distribution PULL: 2016-NOV-20
Assertion failed: thd->is_error() || kill_errno, file C:\build\2016NOV20\mysql-5.6\sql\filesort.cc, line 448
R6010
- abort() has been called
13:43:21 UTC - mysqld got exception 0x80000003 ;
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 = 67958 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x28cbb0bcce0
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...
7ff78cabed55    mysqld.exe!my_sigabrt_handler()[my_thr_init.c:455]
7ff78d0a212f    mysqld.exe!raise()[winsig.c:594]
7ff78d0a4060    mysqld.exe!abort()[abort.c:82]
7ff78d09e9a8    mysqld.exe!_wassert()[assert.c:156]
7ff78c935b7f    mysqld.exe!filesort()[filesort.cc:448]
7ff78c98862c    mysqld.exe!create_sort_index()[sql_executor.cc:3346]
7ff78c982d83    mysqld.exe!st_join_table::sort_table()[sql_executor.cc:2515]
7ff78c980732    mysqld.exe!join_init_read_record()[sql_executor.cc:2389]
7ff78c97f642    mysqld.exe!sub_select()[sql_executor.cc:1259]
7ff78c9852bc    mysqld.exe!do_select()[sql_executor.cc:936]
7ff78c9839c5    mysqld.exe!JOIN::exec()[sql_executor.cc:194]
7ff78c904cce    mysqld.exe!mysql_execute_select()[sql_select.cc:1104]
7ff78c8f7b09    mysqld.exe!mysql_select()[sql_select.cc:1222]
7ff78c8f771d    mysqld.exe!handle_select()[sql_select.cc:110]
7ff78c6f9713    mysqld.exe!mysql_execute_command()[sql_parse.cc:3559]
7ff78c6f5fba    mysqld.exe!mysql_parse()[sql_parse.cc:6416]
7ff78c6ff6a9    mysqld.exe!dispatch_command()[sql_parse.cc:1372]
7ff78c6fe6c5    mysqld.exe!do_command()[sql_parse.cc:1036]
7ff78c7500d2    mysqld.exe!do_handle_one_connection()[sql_connect.cc:982]
7ff78c74ff02    mysqld.exe!handle_one_connection()[sql_connect.cc:900]
7ff78cf7a5f5    mysqld.exe!pfs_spawn_thread()[pfs.cc:1862]
7ff78cabd326    mysqld.exe!pthread_start()[my_winthread.c:62]
7ff78d0b26a5    mysqld.exe!_callthreadstartex()[threadex.c:376]
7ff78d0b28f7    mysqld.exe!_threadstartex()[threadex.c:359]
7ff862608364    KERNEL32.DLL!BaseThreadInitThunk()
7ff862715e91    ntdll.dll!RtlUserThreadStart()