Bug #86251 Assertion `head->variables.gtid_next.type == ANONYMOUS_GROUP' failed.
Submitted: 10 May 2017 2:43 Modified: 10 May 2017 6:07
Reporter: Roel Van de Paar (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Utilities: Binlog Events Severity:S1 (Critical)
Version:5.7.17, 5.7.18 OS:Any
Assigned to: CPU Architecture:Any

[10 May 2017 2:43] Roel Van de Paar
Description:
Version: '5.7.17-debug-log'  socket: '/sda/MS010217-mysql-5.7.17-linux-x86_64-debug/socket.sock'  port: 18388  MySQL Community Server (GPL)
mysqld: /git/mysql-server_dbg/sql/binlog.cc:1154: bool MYSQL_BIN_LOG::assign_automatic_gtids_to_flush_group(THD*): Assertion `head->variables.gtid_next.type == ANONYMOUS_GROUP' failed.
02:19:37 UTC - mysqld got signal 6 ;

Core was generated by `/sda/MS010217-mysql-5.7.17-linux-x86_64-debug/bin/mysqld --no-defaults --sql_mo'.
Program terminated with signal 6, Aborted.
#0  0x00007f5ccf013741 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  0x00007f5ccf013741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000001826d71 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:249
#2  0x0000000000e75574 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f5ccd3a71d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f5ccd3a88c8 in __GI_abort () at abort.c:90
#6  0x00007f5ccd3a0146 in __assert_fail_base (fmt=0x7f5ccd4f13a8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x202a958 "head->variables.gtid_next.type == ANONYMOUS_GROUP", 
    file=file@entry=0x202a350 "/git/mysql-server_dbg/sql/binlog.cc", line=line@entry=1154, 
    function=function@entry=0x2030320 <MYSQL_BIN_LOG::assign_automatic_gtids_to_flush_group(THD*)::__PRETTY_FUNCTION__> "bool MYSQL_BIN_LOG::assign_automatic_gtids_to_flush_group(THD*)") at assert.c:92
#7  0x00007f5ccd3a01f2 in __GI___assert_fail (assertion=0x202a958 "head->variables.gtid_next.type == ANONYMOUS_GROUP", 
    file=0x202a350 "/git/mysql-server_dbg/sql/binlog.cc", line=1154, 
    function=0x2030320 <MYSQL_BIN_LOG::assign_automatic_gtids_to_flush_group(THD*)::__PRETTY_FUNCTION__> "bool MYSQL_BIN_LOG::assign_automatic_gtids_to_flush_group(THD*)") at assert.c:101
#8  0x0000000001789afa in MYSQL_BIN_LOG::assign_automatic_gtids_to_flush_group (this=0x2b5da40 <mysql_bin_log>, first_seen=
    0x7f5c91819000) at /git/mysql-server_dbg/sql/binlog.cc:1154
#9  0x000000000179a959 in MYSQL_BIN_LOG::process_flush_stage_queue (this=0x2b5da40 <mysql_bin_log>, total_bytes_var=0x7f5ccf603198, 
    rotate_var=0x7f5ccf603197, out_queue_var=0x7f5ccf603188) at /git/mysql-server_dbg/sql/binlog.cc:8359
#10 0x000000000179be8a in MYSQL_BIN_LOG::ordered_commit (this=0x2b5da40 <mysql_bin_log>, thd=0x7f5c91819000, all=true, 
    skip_commit=false) at /git/mysql-server_dbg/sql/binlog.cc:8996
#11 0x000000000179a5eb in MYSQL_BIN_LOG::commit (this=0x2b5da40 <mysql_bin_log>, thd=0x7f5c91819000, all=true)
    at /git/mysql-server_dbg/sql/binlog.cc:8257
#12 0x0000000000eeef8f in ha_commit_trans (thd=0x7f5c91819000, all=true, ignore_global_read_lock=false)
    at /git/mysql-server_dbg/sql/handler.cc:1796
#13 0x00000000015f30ae in trans_commit_implicit (thd=0x7f5c91819000) at /git/mysql-server_dbg/sql/transaction.cc:307
#14 0x00000000014f395a in mysql_execute_command (thd=0x7f5c91819000, first_level=true) at /git/mysql-server_dbg/sql/sql_parse.cc:2658
#15 0x00000000014fb5f5 in mysql_parse (thd=0x7f5c91819000, parser_state=0x7f5ccf605550) at /git/mysql-server_dbg/sql/sql_parse.cc:5611
#16 0x00000000014f0c1d in dispatch_command (thd=0x7f5c91819000, com_data=0x7f5ccf605cb0, command=COM_QUERY)
    at /git/mysql-server_dbg/sql/sql_parse.cc:1461
#17 0x00000000014efa44 in do_command (thd=0x7f5c91819000) at /git/mysql-server_dbg/sql/sql_parse.cc:999
#18 0x000000000161f9d0 in handle_connection (arg=0x7f5ca4788960)
    at /git/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:300
#19 0x00000000018534f9 in pfs_spawn_thread (arg=0x7f5cb2e76120) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:2188
#20 0x00007f5ccf00edc5 in start_thread (arg=0x7f5ccf606700) at pthread_create.c:308
#21 0x00007f5ccd46973d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
# mysqld options required for replay:  --sql_mode= --server-id=100 --log-bin
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1 (a BINARY (1)) ROW_FORMAT=COMPRESSED ENGINE=InnoDB;
SET autocommit=0;
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8));
BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC ';
CREATE TABLE t1 (i CHAR (1)) ENGINE=InnoDB;
[10 May 2017 6:07] Umesh Shastry
Hello Roel,

Thank you for the report and test case.
Observed that 5.7.18 debug build is affected.

Thanks,
Umesh