Bug #100125 Assertion "binlog_checksum_options == var->save_result.ulonglong_value"
Submitted: 6 Jul 2020 13:19 Modified: 6 Jul 2020 14:36
Reporter: Hrvoje Matijakovic Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S6 (Debug Builds)
Version:8.0.20 OS:Linux
Assigned to: CPU Architecture:x86

[6 Jul 2020 13:19] Hrvoje Matijakovic
Description:
Combination of gtid innodb-force-recoverand can result in "binlog_checksum_options == var->save_result.ulonglong_value" assertion on the debug build. 

I wasn't able to reproduce this on a release build. This also looks similar to Bug #97312 (which should be fixed in 8.0.19).

gdb from the debug build:
Core was generated by `/sdc/MS270420-mysql-8.0.20-linux-x86_64-debug/bin/mysqld --no-defaults --basedi'.
Program terminated with signal 6, Aborted.
#0  0x00007fc516e87aa1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
59        val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
+bt
#0  0x00007fc516e87aa1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
#1  0x0000000004aa3c56 in my_write_core (sig=6) at /sdc/MS-8.0.20_dbg/mysys/stacktrace.cc:308
#2  0x000000000374f2b5 in handle_fatal_signal (sig=6) at /sdc/MS-8.0.20_dbg/sql/signal_handler.cc:171
#3  <signal handler called>
#4  0x00007fc514cce387 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
#5  0x00007fc514ccfa78 in __GI_abort () at abort.c:90
#6  0x00007fc514cc71a6 in __assert_fail_base (fmt=0x7fc514e22ce0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5e1ebb8 "binlog_checksum_options == var->save_result.ulonglong_value", file=file@entry=0x5e1e528 "/sdc/MS-8.0.20_dbg/sql/sys_vars.cc", line=line@entry=3835, function=function@entry=0x5e2df00 <Sys_var_enum_binlog_checksum::global_update(THD*, set_var*)::__PRETTY_FUNCTION__> "virtual bool Sys_var_enum_binlog_checksum::global_update(THD*, set_var*)") at assert.c:92
#7  0x00007fc514cc7252 in __GI___assert_fail (assertion=0x5e1ebb8 "binlog_checksum_options == var->save_result.ulonglong_value", file=0x5e1e528 "/sdc/MS-8.0.20_dbg/sql/sys_vars.cc", line=3835, function=0x5e2df00 <Sys_var_enum_binlog_checksum::global_update(THD*, set_var*)::__PRETTY_FUNCTION__> "virtual bool Sys_var_enum_binlog_checksum::global_update(THD*, set_var*)") at assert.c:101                                                                                          #8  0x00000000036ae3f3 in Sys_var_enum_binlog_checksum::global_update (this=0x7f28fc0 <Binlog_checksum_enum>, thd=0x7fc4c7c20000, var=0x7fc4c7cd2258) at /sdc/MS-8.0.20_dbg/sql/sys_vars.cc:3835                                              #9  0x000000000346eaee in sys_var::update (this=0x7f28fc0 <Binlog_checksum_enum>, thd=0x7fc4c7c20000, var=0x7fc4c7cd2258) at /sdc/MS-8.0.20_dbg/sql/set_var.cc:295                                                                            #10 0x0000000003471363 in set_var::update (this=0x7fc4c7cd2258, thd=0x7fc4c7c20000) at /sdc/MS-8.0.20_dbg/sql/set_var.cc:1082
#11 0x000000000347051b in sql_set_variables (thd=0x7fc4c7c20000, var_list=0x7fc4c7c25ab8, opened=true) at /sdc/MS-8.0.20_dbg/sql/set_var.cc:788
#12 0x000000000357c229 in mysql_execute_command (thd=0x7fc4c7c20000, first_level=true) at /sdc/MS-8.0.20_dbg/sql/sql_parse.cc:3524
#13 0x0000000003581e3b in mysql_parse (thd=0x7fc4c7c20000, parser_state=0x7fc517357ae0) at /sdc/MS-8.0.20_dbg/sql/sql_parse.cc:5306                                                                                                           #14 0x00000000035771cb in dispatch_command (thd=0x7fc4c7c20000, com_data=0x7fc517358b90, command=COM_QUERY) at /sdc/MS-8.0.20_dbg/sql/sql_parse.cc:1776
#15 0x00000000035756db in do_command (thd=0x7fc4c7c20000) at /sdc/MS-8.0.20_dbg/sql/sql_parse.cc:1274
#16 0x0000000003739c03 in handle_connection (arg=0x7fc4c7183260) at /sdc/MS-8.0.20_dbg/sql/conn_handler/connection_handler_per_thread.cc:302                                                                                                  #17 0x00000000052b711a in pfs_spawn_thread (arg=0x7fc512c648a0) at /sdc/MS-8.0.20_dbg/storage/perfschema/pfs.cc:2854
#18 0x00007fc516e82ea5 in start_thread (arg=0x7fc517359700) at pthread_create.c:307
#19 0x00007fc514d968dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) quit

How to repeat:
# mysqld options required for replay:  --gtid_mode=ON --enforce_gtid_consistency=ON --innodb-force-recovery=2
CREATE DATABASE transforms;
set @@global.binlog_checksum=NONE;
[6 Jul 2020 14:36] MySQL Verification Team
Hello Hrvoje Matijakovic,

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

regards,
Umesh
[10 Jul 2020 8:37] Erlend Dahl
Posted by developer:
 
This affects 5.7 too, just turn on the binlog: --log-bin=1