Bug #80668 InnoDB: Failing assertion: !m_fatal in in file ut0ut.cc line 938
Submitted: 9 Mar 2016 7:27 Modified: 15 Mar 2016 4:51
Reporter: Ramesh Sivaraman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.7.10, 5.7.11 OS:CentOS
Assigned to: CPU Architecture:Any
Tags: debug

[9 Mar 2016 7:27] Ramesh Sivaraman
Description:
Server is crashing when we set the size of innodb-log-buffer-size greater than max value

PS - max value to allocate innodb-log-buffer-size is 4294967295

Error info

2016-03-09T07:21:09.262567Z 0 [ERROR] InnoDB: Cannot allocate 42949657112 bytes of memory after 60 retries over 60 seconds. OS error: Cannot allocate memory (12). Check if you should increase the swap file or ulimits of your operating system. Note that on most 32-bit computers the process memory space is limited to 2 GB or 4 GB.
2016-03-09 02:21:09 0x7f4b4bc2c880  InnoDB: Assertion failure in thread 139961370331264 in file ut0ut.cc line 938
InnoDB: Failing assertion: !m_fatal

GDB info

#0  0x00007f4b4b5dc741 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000017ef51c in my_write_core (sig=6) at /sda/mysql-server_dbg/mysys/stacktrace.c:247
#2  0x0000000000e583e4 in handle_fatal_signal (sig=6) at /sda/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f4b497685f7 in raise () from /lib64/libc.so.6
#5  0x00007f4b49769ce8 in abort () from /lib64/libc.so.6
#6  0x0000000001b36ea3 in ut_dbg_assertion_failed (expr=0x20d189e "!m_fatal", file=0x20d1008 "/sda/mysql-server_dbg/storage/innobase/ut/ut0ut.cc", line=938) at /sda/mysql-server_dbg/storage/innobase/ut/ut0dbg.cc:67
#7  0x0000000001b3b94d in ib::fatal_or_error::~fatal_or_error (this=0x7ffccf230660, __in_chrg=<optimized out>) at /sda/mysql-server_dbg/storage/innobase/ut/ut0ut.cc:938
#8  0x000000000192eec8 in ut_allocator<unsigned char>::allocate (this=0x7ffccf230810, n_elements=42949657088, hint=0x0, file=0x207d468 "/sda/mysql-server_dbg/storage/innobase/log/log0log.cc", set_to_zero=true, throw_on_error=false) at /sda/mysql-server_dbg/storage/innobase/include/ut0new.h:354
#9  0x00000000019aacd7 in log_init () at /sda/mysql-server_dbg/storage/innobase/log/log0log.cc:759
#10 0x0000000001ad7790 in innobase_start_or_create_for_mysql () at /sda/mysql-server_dbg/storage/innobase/srv/srv0start.cc:1807
#11 0x000000000190d194 in innobase_init (p=0x7f4b3ffbc4a0) at /sda/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:3714
#12 0x0000000000ecfd60 in ha_initialize_handlerton (plugin=0x7f4b3d3dde60) at /sda/mysql-server_dbg/sql/handler.cc:837
#13 0x0000000001510d5e in plugin_initialize (plugin=0x7f4b3d3dde60) at /sda/mysql-server_dbg/sql/sql_plugin.cc:1178
#14 0x0000000001511615 in plugin_init (argc=0x2adb0f0 <remaining_argc>, argv=0x7f4b4741e900, flags=0) at /sda/mysql-server_dbg/sql/sql_plugin.cc:1435
#15 0x0000000000e47727 in init_server_components () at /sda/mysql-server_dbg/sql/mysqld.cc:3962
#16 0x0000000000e48acf in mysqld_main (argc=12, argv=0x7f4b4741e900) at /sda/mysql-server_dbg/sql/mysqld.cc:4586
#17 0x0000000000e40a50 in main (argc=12, argv=0x7ffccf239178) at /sda/mysql-server_dbg/sql/main.cc:25

How to repeat:

Start the server with --innodb-log-buffer-size=42949672950
[9 Mar 2016 9:01] MySQL Verification Team
Hello Ramesh,

Thank you for the report.
Observed with 5.7.11 release build(only on small boxes, with <8G memory).

- 5.7.11 release build(this assertion could be intentional)

2016-03-11T15:16:18.842232Z 0 [Note] InnoDB: Initializing buffer pool, total size = 2G, instances = 8, chunk size = 128M
2016-03-11T15:16:19.221618Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-03-11T15:17:18.230599Z 0 [ERROR] InnoDB: Cannot allocate 42949657112 bytes of memory after 60 retries over 60 seconds. OS error: Cannot allocate memory (12). Check if you should increase the swap file or ulimits of your operating system. Note that on most 32-bit computers the process memory space is limited to 2 GB or 4 GB.
2016-03-11 20:47:18 0x7f511df69720  InnoDB: Assertion failure in thread 139986371778336 in file ut0ut.cc line 935
InnoDB: Failing assertion: !m_fatal
InnoDB: We intentionally generate a memory trap.

- conf

[root@cluster-repo ~]# cat /etc/my.cnf|grep innodb_log
innodb_log_buffer_size=42949672950

Thanks,
Umesh
[15 Mar 2016 4:24] Sunny Bains
Ramesh, Why is this a bug? Or, what do you think InnoDB should do in this case?
[15 Mar 2016 4:51] Ramesh Sivaraman
Hi Sunny,

Instead of a crash server should reset innodb-log-buffer-size into max value if it is greater than max value. Same as table_open_cache

Thanks,
Ramesh
[16 Mar 2016 2:56] Sunny Bains
Ramesh, We are moving away from such "automatic" adjustment, where possible. Therefore I don't think this is a bug. One option will be to quit instead of crashing.