Bug #81450 void make_sortkey(SORTPARAM*, uchar*, uchar*): Assertion `0' failed make_sortkey

Submitted: 17 May 2016 5:28 Modified: 16 Dec 2019 22:33
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.5.49 OS:Any
Assigned to: CPU Architecture:Any

[17 May 2016 5:28] Roel Van de Paar
Description:
mysqld: /git/mysql-server/sql/filesort.cc:857: void make_sortkey(SORTPARAM*, uchar*, uchar*): Assertion `0' failed.
05:13:26 UTC - mysqld got signal 6 ;

+bt
#0  0x00007fef37bf7741 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000007de0c8 in my_write_core (sig=6) at /git/mysql-server/mysys/stacktrace.c:433
#2  0x00000000006a1088 in handle_fatal_signal (sig=6) at /git/mysql-server/sql/signal_handler.cc:247
#3  <signal handler called>
#4  0x00007fef36c185f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007fef36c19ce8 in __GI_abort () at abort.c:90
#6  0x00007fef36c11566 in __assert_fail_base (fmt=0x7fef36d61228 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xb0df21 "0", file=file@entry=0xafc990 "/git/mysql-server/sql/filesort.cc", line=line@entry=857, function=function@entry=0xafcb60 <make_sortkey(st_sort_param*, unsigned char*, unsigned char*)::__PRETTY_FUNCTION__> "void make_sortkey(SORTPARAM*, uchar*, uchar*)") at assert.c:92
#7  0x00007fef36c11612 in __GI___assert_fail (assertion=0xb0df21 "0", file=0xafc990 "/git/mysql-server/sql/filesort.cc", line=857, function=0xafcb60 <make_sortkey(st_sort_param*, unsigned char*, unsigned char*)::__PRETTY_FUNCTION__> "void make_sortkey(SORTPARAM*, uchar*, uchar*)") at assert.c:101
#8  0x000000000069f9aa in make_sortkey (ref_pos=0x7fee9de55cc0 "", to=0x7fee9df19613 "", param=0x7fef382069f0) at /git/mysql-server/sql/filesort.cc:857
#9  find_all_keys (tempfile=0x7fef38206a70, buffpek_pointers=0x7fef38206b90, sort_keys=0x7fee9df172c0, select=0x7fee9de26bf8, param=0x7fef382069f0) at /git/mysql-server/sql/filesort.cc:671
#10 filesort (thd=thd@entry=0x7feea2ba8000, table=table@entry=0x7fee9dee0c00, sortorder=<optimized out>, s_length=<optimized out>, select=select@entry=0x7fee9de26bf8, max_rows=max_rows@entry=18446744073709551615, sort_positions=sort_positions@entry=false, examined_rows=examined_rows@entry=0x7fef38207128) at /git/mysql-server/sql/filesort.cc:256
#11 0x00000000005bfd0f in create_sort_index (thd=0x7feea2ba8000, join=join@entry=0x7fee9de5e010, order=<optimized out>, filesort_limit=18446744073709551615, select_limit=18446744073709551615, is_order_by=<optimized out>) at /git/mysql-server/sql/sql_select.cc:14311
#12 0x00000000005d26ad in JOIN::exec (this=this@entry=0x7fee9de5e010) at /git/mysql-server/sql/sql_select.cc:2369
#13 0x00000000005cc82d in mysql_select (thd=thd@entry=0x7feea2ba8000, rref_pointer_array=rref_pointer_array@entry=0x7feea2baa260, tables=0x7fee9de25a28, wild_num=0, fields=..., conds=<optimized out>, og_num=1, order=0x0, group=0x7fee9de26058, having=0x0, proc_param=0x0, select_options=select_options@entry=2147748608, result=result@entry=0x7fee9de26120, unit=unit@entry=0x7feea2ba9a58, select_lex=select_lex@entry=0x7feea2baa078) at /git/mysql-server/sql/sql_select.cc:2619
#14 0x00000000005cca25 in handle_select (thd=thd@entry=0x7feea2ba8000, lex=lex@entry=0x7feea2ba99a8, result=result@entry=0x7fee9de26120, setup_tables_done_option=setup_tables_done_option@entry=0) at /git/mysql-server/sql/sql_select.cc:297
#15 0x0000000000583b27 in execute_sqlcom_select (thd=thd@entry=0x7feea2ba8000, all_tables=<optimized out>) at /git/mysql-server/sql/sql_parse.cc:4625
#16 0x00000000005899c6 in mysql_execute_command (thd=thd@entry=0x7feea2ba8000) at /git/mysql-server/sql/sql_parse.cc:2176
#17 0x0000000000590ff6 in mysql_parse (thd=thd@entry=0x7feea2ba8000, rawbuf=<optimized out>, length=59, parser_state=parser_state@entry=0x7fef38208680) at /git/mysql-server/sql/sql_parse.cc:5780
#18 0x0000000000592843 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7feea2ba8000, packet=packet@entry=0x7feea2b9abc1 "select group_concat(i),make_set(i,0,0) f FROM t1 group by f", packet_length=packet_length@entry=59) at /git/mysql-server/sql/sql_parse.cc:1038
#19 0x00000000005946cc in do_command (thd=0x7feea2ba8000) at /git/mysql-server/sql/sql_parse.cc:773
#20 0x000000000063c978 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7feea2ba8000) at /git/mysql-server/sql/sql_connect.cc:862
#21 0x000000000063ca35 in handle_one_connection (arg=0x7feea2ba8000) at /git/mysql-server/sql/sql_connect.cc:781
#22 0x00007fef37bf2dc5 in start_thread (arg=0x7fef38209700) at pthread_create.c:308
#23 0x00007fef36cd921d 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 int,KEY a_data (a));
INSERT INTO t1 VALUES(null);
create TEMPORARY TABLE t2 engine=heap select * from t1;
create temporary table t1(i int)ENGINE=InnoDB;
insert into t1 values(1);
insert into t1 select * from t2;
select group_concat(i),make_set(i,0,0) f FROM t1 group by f;
[17 May 2016 6:22] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that 5.5.49(also, 5.5.51 daily build) debug build is
affected.

Thanks,
Umesh
[17 May 2016 6:23] MySQL Verification Team
I'm not able to repeat this issue on 5.6.30/5.7.12 release/debug builds
with the provided test case.
[18 May 2016 13:24] Tor Didriksen
Posted by developer:
 
Same bug (but different crash call stack) as
    Bug#12911480: GROUP BY MAKE SET WITH EMPTY SET VALUES CRASH IN MY_HASH_SORT_SIMPLE
[16 Dec 2019 22:33] Roy Lyseng
Posted by developer:
 
Fixed in 5.6.30

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.