Bug #93651 Assertion failure in space_id == page_get_space_id(buf_block_get_frame(block))
Submitted: 18 Dec 2018 11:49 Modified: 18 Dec 2018 21:48
Reporter: Ramesh Sivaraman Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S6 (Debug Builds)
Version:8.0.13 OS:Ubuntu
Assigned to: CPU Architecture:Any
Tags: debug

[18 Dec 2018 11:49] Ramesh Sivaraman
Description:
GDB info

#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
62      ../sysdeps/unix/sysv/linux/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7fe9c17fd700 (LWP 11495))]
(gdb) bt
+bt
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1  0x000000000452fdd9 in my_write_core (sig=6) at /qa/binaries/MS-80_dbg/mysys/stacktrace.cc:278
#2  0x00000000031b367d in handle_fatal_signal (sig=6) at /qa/binaries/MS-80_dbg/sql/signal_handler.cc:249
#3  <signal handler called>
#4  0x00007fea424d4428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#5  0x00007fea424d602a in __GI_abort () at abort.c:89
#6  0x000000000499afdb in ut_dbg_assertion_failed (expr=0x5caef50 "space_id == page_get_space_id(buf_block_get_frame(block))", file=0x5cae668 "/qa/binaries/MS-80_dbg/storage/innobase/fsp/fsp0fsp.cc", line=897) at /qa/binaries/MS-80_dbg/storage/innobase/ut/ut0dbg.cc:90
#7  0x0000000004b2cd43 in fsp_header_write_encryption (space_id=4294967176, space_flags=8192, encrypt_info=0x7fe9c17fcbb0 "lCC", update_fsp_flags=true, rotate_encryption=false, mtr=0x7fe9c17fc680) at /qa/binaries/MS-80_dbg/storage/innobase/fsp/fsp0fsp.cc:897
#8  0x0000000004913285 in srv_enable_undo_encryption_if_set () at /qa/binaries/MS-80_dbg/storage/innobase/srv/srv0srv.cc:2412
#9  0x0000000004913a16 in srv_master_thread () at /qa/binaries/MS-80_dbg/storage/innobase/srv/srv0srv.cc:2550
#10 0x000000000470f361 in std::_Bind<void (*())()>::__call<void>(std::tuple<>&&, std::_Index_tuple<>) (this=0x7fe9c17fcd40, __args=<unknown type in /qa/binaries/mysql-8.0.13-linux-x86_64-debug/bin/mysqld, CU 0xaf7945a, DIE 0xb0ff27f>) at /usr/include/c++/5/functional:1074
#11 0x000000000470f049 in std::_Bind<void (*())()>::operator()<, void>() (this=0x7fe9c17fcd40) at /usr/include/c++/5/functional:1133
#12 0x000000000470ee3f in Runnable::operator()<void (*)()>(void (*&&)()) (this=0x7fea287b8440, f=<unknown type in /qa/binaries/mysql-8.0.13-linux-x86_64-debug/bin/mysqld, CU 0xaf7945a, DIE 0xb0fe935>) at /qa/binaries/MS-80_dbg/storage/innobase/include/os0thread-create.h:92
#13 0x000000000470ebe9 in std::_Bind_simple<Runnable (void (*)())>::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x7fea287b8438) at /usr/include/c++/5/functional:1531
#14 0x000000000470e8f0 in std::_Bind_simple<Runnable (void (*)())>::operator()() (this=0x7fea287b8438) at /usr/include/c++/5/functional:1520
#15 0x000000000470e26c in std::thread::_Impl<std::_Bind_simple<Runnable (void (*)())> >::_M_run() (this=0x7fea287b8420) at /usr/include/c++/5/thread:115
#16 0x00007fea42e40c80 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#17 0x00007fea441f26ba in start_thread (arg=0x7fe9c17fd700) at pthread_create.c:333
#18 0x00007fea425a641d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

How to repeat:
rm -Rf /dev/shm/1545120447
mkdir -p /dev/shm/1545120447/tmp

/qa/binaries/mysql-8.0.13-linux-x86_64-debug/bin/mysqld --no-defaults --initialize-insecure --basedir=/qa/binaries/mysql-8.0.13-linux-x86_64-debug --datadir=/dev/shm/1545120447/data

/qa/binaries/mysql-8.0.13-linux-x86_64-debug/bin/mysqld --no-defaults --basedir=/qa/binaries/mysql-8.0.13-linux-x86_64-debug --datadir=/dev/shm/1545120447/data --tmpdir=/dev/shm/1545120447/tmp --port=32649 --pid-file=/dev/shm/1545120447/pid.pid --core-file --socket=/dev/shm/1545120447/socket.sock --early-plugin-load=keyring_file.so --keyring_file_data=keyring --innodb_undo_log_encrypt=1 --performance-schema-max-rwlock-classes=2047 --log-error=/dev/shm/1545120447/error.log.out &

SQL

SET @@GLOBAL.innodb_undo_tablespaces=128;
[18 Dec 2018 21:40] MySQL Verification Team
Repeatable with version 8.0.13:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.13-debug Source distribution

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET @@GLOBAL.innodb_undo_tablespaces=128;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> 

2018-12-18T21:35:43.940627Z 0 [System] [MY-010931] [Server] /home/miguel/bug/8.0//bin/mysqld: ready for connections. Version: '8.0.13-debug'  socket: '/tmp/mysql.sock'  port: 32649  Source distribution.
2018-12-18T21:35:44.030092Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/tmp/mysqlx.sock' bind-address: '::' port: 33060
2018-12-18T21:36:21.475377Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: fsp0fsp.cc:897:space_id == page_get_space_id(buf_block_get_frame(block)) thread 139849000531712
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
21:36:21 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=2
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 67877 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f3110000bb0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f3121ffab70 thread_stack 0x46000
/home/miguel/bug/8.0//bin/mysqld(my_print_stacktrace(unsigned char*, unsigned long)+0x55) [0x55d3f9f2c270]
/home/miguel/bug/8.0//bin/mysqld(handle_fatal_signal+0x3f2) [0x55d3f8c022ed]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12dd0) [0x7f3194f63dd0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7) [0x7f3194508077]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121) [0x7f31944e9535]
/home/miguel/bug/8.0//bin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x1a5) [0x55d3fa3197ab]
/home/miguel/bug/8.0//bin/mysqld(fsp_header_write_encryption(unsigned int, unsigned long, unsigned char*, bool, bool, mtr_t*)+0xfa) [0x55d3fa4a20c0]
/home/miguel/bug/8.0//bin/mysqld(+0x43d830e) [0x55d3fa29830e]
/home/miguel/bug/8.0//bin/mysqld(srv_master_thread()+0x1d4) [0x55d3fa298a6a]
/home/miguel/bug/8.0//bin/mysqld(void std::__invoke_impl<void, void (*&)()>(std::__invoke_other, void (*&)())+0x1d) [0x55d3fa09f92c]
/home/miguel/bug/8.0//bin/mysqld(std::__invoke_result<void (*&)()>::type std::__invoke<void (*&)()>(void (*&)())+0x2f) [0x55d3fa09e56e]
/home/miguel/bug/8.0//bin/mysqld(void std::_Bind<void (*())()>::__call<void>(std::tuple<>&&, std::_Index_tuple<>)+0x1c) [0x55d3fa09c654]
/home/miguel/bug/8.0//bin/mysqld(void std::_Bind<void (*())()>::operator()<, void>()+0x33) [0x55d3fa09a661]
/home/miguel/bug/8.0//bin/mysqld(void Runnable::operator()<void (*)()>(void (*&&)())+0x55) [0x55d3fa098215]
/home/miguel/bug/8.0//bin/mysqld(void std::__invoke_impl<void, Runnable, void (*)()>(std::__invoke_other, Runnable&&, void (*&&)())+0x37) [0x55d3fa093a10]
/home/miguel/bug/8.0//bin/mysqld(std::__invoke_result<Runnable, void (*)()>::type std::__invoke<Runnable, void (*)()>(Runnable&&, void (*&&)())+0x46) [0x55d3fa08da36]
/home/miguel/bug/8.0//bin/mysqld(decltype (__invoke((_S_declval<0ul>)(), (_S_declval<1ul>)())) std::thread::_Invoker<std::tuple<Runnable, void (*)()> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>)+0x43) [0x55d3fa0a0f1f]
/home/miguel/bug/8.0//bin/mysqld(std::thread::_Invoker<std::tuple<Runnable, void (*)()> >::operator()()+0x27) [0x55d3fa0a0d01]
/home/miguel/bug/8.0//bin/mysqld(std::thread::_State_impl<std::thread::_Invoker<std::tuple<Runnable, void (*)()> > >::_M_run()+0x1c) [0x55d3fa0a06fa]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xbd63f) [0x7f319491563f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8164) [0x7f3194f59164]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f31945e1def]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): Connection ID (thread ID): 0
Status: NOT_KILLED
[18 Dec 2018 21:48] MySQL Verification Team
Thank you for the bug report. Repeatable with version reported 8.0.13 but not anymore with most source server:

iguel@tikal:~/bug $ 8.0/bin/mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.15-debug Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET @@GLOBAL.innodb_undo_tablespaces=128;
Query OK, 0 rows affected, 1 warning (0,00 sec)

mysql> SHOW WARNINGS;
+---------+------+----------------------------------------------------------+
| Level   | Code | Message                                                  |
+---------+------+----------------------------------------------------------+
| Warning | 1292 | Truncated incorrect innodb_undo_tablespaces value: '128' |
+---------+------+----------------------------------------------------------+
1 row in set (0,00 sec)

mysql>
[21 Dec 2018 12:15] Roel Van de Paar
Also see bug 93717