Bug #90522 [MySQL 8.0 GA Release Build] InnoDB: Assertion failure: (n & (n - 1)) == 0
Submitted: 20 Apr 2018 6:12 Modified: 30 Apr 2018 18:10
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Options Severity:S1 (Critical)
Version:8.0.11 GA OS:Any
Assigned to: CPU Architecture:Any
Tags: Release Build

[20 Apr 2018 6:12] Roel Van de Paar
Description:
2018-04-20T06:09:46.494917Z 0 [System] [MY-010116] [Server] /sda/mysql-8.0.11-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.11) starting as process 1578
2018-04-20T06:09:46.588128Z 1 [ERROR] [MY-000000] [InnoDB] InnoDB: Assertion failure: log0log.cc:1035:(n & (n - 1)) == 0
InnoDB: thread 140611839588096

(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x00000000019fc317 in my_write_core (sig=sig@entry=6) at ../../mysql-8.0.11/mysys/stacktrace.cc:278
#2  0x0000000000ccc895 in handle_fatal_signal (sig=6) at ../../mysql-8.0.11/sql/signal_handler.cc:249
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x00007fe2d2133801 in __GI_abort () at abort.c:79
#6  0x0000000000ac6ea8 in ut_dbg_assertion_failed (expr=expr@entry=0x2073f87 "(n & (n - 1)) == 0", 
    file=file@entry=0x27b2fa8 "../../../mysql-8.0.11/storage/innobase/log/log0log.cc", line=line@entry=1035)
    at ../../../mysql-8.0.11/storage/innobase/ut/ut0dbg.cc:90
#7  0x0000000001be5374 in log_allocate_write_events (log=..., log=...) at ../../../mysql-8.0.11/storage/innobase/log/log0log.cc:1035
#8  log_sys_init (n_files=n_files@entry=2, file_size=<optimized out>, space_id=space_id@entry=4294967280)
    at ../../../mysql-8.0.11/storage/innobase/log/log0log.cc:537
#9  0x0000000001cc71b6 in srv_start (create_new_db=create_new_db@entry=false, scan_directories="./;./;./")
    at ../../../mysql-8.0.11/storage/innobase/srv/srv0start.cc:2032
#10 0x0000000001b6fd25 in innobase_init_files (tablespaces=0x7fe2bebfd6e0, dict_init_mode=<optimized out>)
    at ../../../mysql-8.0.11/storage/innobase/handler/ha_innodb.cc:4413
#11 innobase_ddse_dict_init (dict_init_mode=<optimized out>, version=<optimized out>, tables=0x7fe2bebfd6c0, 
    tablespaces=0x7fe2bebfd6e0) at ../../../mysql-8.0.11/storage/innobase/handler/ha_innodb.cc:10823
#12 0x000000000199cc97 in dd::bootstrap::DDSE_dict_init (thd=<optimized out>, dict_init_mode=DICT_INIT_CHECK_FILES, version=80011)
    at ../../mysql-8.0.11/sql/dd/impl/bootstrapper.cc:2079
#13 0x0000000001994c76 in dd::upgrade_57::do_pre_checks_and_initialize_dd (thd=0x7fe2bff6c000)
    at ../../mysql-8.0.11/sql/dd/upgrade/upgrade.cc:891
#14 0x0000000000d70f06 in bootstrap::handle_bootstrap (arg=arg@entry=0x7fe2bff6c000) at ../../mysql-8.0.11/sql/bootstrap.cc:346
#15 0x0000000001aa5f5f in pfs_spawn_thread (arg=0x7fe2c6bfc520) at ../../../mysql-8.0.11/storage/perfschema/pfs.cc:2814
#16 0x00007fe2d3ed56db in start_thread (arg=0x7fe2bebff700) at pthread_create.c:463
#17 0x00007fe2d221488f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

How to repeat:
Start mysqld with --innodb-log-write-events=12
[20 Apr 2018 6:15] Roel Van de Paar
There may or may not be other mysqld options that cause this bug, it was seen quite a few times.
[20 Apr 2018 6:21] Roel Van de Paar
Potentially related to bug 90523
[20 Apr 2018 6:25] MySQL Verification Team
Hello Roel,

Thank you for the report and feedback.

Thanks,
Umesh
[20 Apr 2018 10:16] Pawel Olchawa
Thank you for the report.

This is one of new variables, which were not supposed to be exposed. The fix is to hide them in normal builds. During our tests we have not encountered any situation in which it would make sense to change their values.
[20 Apr 2018 21:49] Roel Van de Paar
> This is one of new variables, which were not supposed to be exposed. 
But it is;

$ ./bin/mysqld --no-defaults --help --verbose | grep "innodb-log-write-events"
2018-04-20T21:45:45.585190Z 0 [System] [MY-010116] [Server] /sda/mysql-8.0.11-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.11) starting as process 26380
  --innodb-log-write-events=# 
innodb-log-write-events                                      2048 

> The fix is to hide them in normal builds.
Is this a statement or a proposed fix?
If it is a proposed fix, then why was this bug closed?
If it is a statement, then it is not accurate; as per the above (this is release build downloaded from mysql.com) 

> During our tests we have not encountered any situation in which it would make sense to change their values.
I do not see how this is relevant to this report.
[30 Apr 2018 18:10] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.12 release, and here's the changelog entry:

An assertion failure occurred when starting the server with experimental
system variables that were unintentionally exposed in normal MySQL builds.
[25 May 2019 15:14] zhai weixiang
Not fully fixed, ref bug#95404