Bug #80820 mysqld got signal 11 while altering tablespace with encryption enabled table
Submitted: 22 Mar 2016 9:22 Modified: 6 May 2016 10:48
Reporter: Shahriyar Rzayev Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:5.7.11 OS:Any
Assigned to: CPU Architecture:Any

[22 Mar 2016 9:22] Shahriyar Rzayev
Description:
Hi dear experts,
Tested with MySQL 5.7.11-debug-valgrind build:

CREATE TABLE `sbtest1` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `k` int(10) unsigned NOT NULL DEFAULT '0',
  `c` char(120) NOT NULL DEFAULT '',
  `pad` char(60) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `k_1` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=473089 DEFAULT CHARSET=utf8 MAX_ROWS=1000000 COMPRESSION='lz4' ENCRYPTION='Y'

mysql> create tablespace t2 add datafile '/home/mysql_tablespaces/t2.ibd' engine=innodb;
Query OK, 0 rows affected (0,00 sec)

mysql> alter table sbtest1 tablespace=t2;
ERROR 2013 (HY000): Lost connection to MySQL server during query

09:14:30 UTC - mysqld got signal 11
/opt/mysql5711/bin/mysqld(my_print_stacktrace+0x38)[0x186b149]
/opt/mysql5711/bin/mysqld(handle_fatal_signal+0x3f6)[0xe6b95b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)[0x7f21dd305340]
/opt/mysql5711/bin/mysqld(_ZN12ut_allocatorIhE16deallocate_traceEPK12ut_new_pfx_t+0x25)[0x18f2fa7]
/opt/mysql5711/bin/mysqld(_ZN12ut_allocatorIhE10deallocateEPhm+0x3c)[0x18f0e4c]
/opt/mysql5711/bin/mysqld(_Z19dict_mem_table_freeP12dict_table_t+0x159)[0x1bf6cef]
/opt/mysql5711/bin/mysqld(_ZN19create_table_info_t16create_table_defEv+0x1083)[0x18ef159]
/opt/mysql5711/bin/mysqld(_ZN19create_table_info_t12create_tableEv+0xa8)[0x18db93a]
/opt/mysql5711/bin/mysqld(_ZN11ha_innobase6createEPKcP5TABLEP24st_ha_create_information+0x1a0)[0x18dc534]
/opt/mysql5711/bin/mysqld(_ZN7handler9ha_createEPKcP5TABLEP24st_ha_create_information+0x74)[0xef1c9e]
/opt/mysql5711/bin/mysqld(_Z15ha_create_tableP3THDPKcS2_S2_P24st_ha_create_informationbb+0x25e)[0xef22b9]
/opt/mysql5711/bin/mysqld(_Z17mysql_alter_tableP3THDPKcS2_P24st_ha_create_informationP10TABLE_LISTP10Alter_info+0x1eaa)[0x15a8374]
/opt/mysql5711/bin/mysqld(_ZN19Sql_cmd_alter_table7executeEP3THD+0x59d)[0x17300e7]
/opt/mysql5711/bin/mysqld(_Z21mysql_execute_commandP3THDb+0x6ba4)[0x150f2f5]
/opt/mysql5711/bin/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x518)[0x15112e2]
/opt/mysql5711/bin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0xbb9)[0x1506394]
/opt/mysql5711/bin/mysqld(_Z10do_commandP3THD+0x4b2)[0x15052ed]
/opt/mysql5711/bin/mysqld(handle_connection+0x1ec)[0x16439af]
/opt/mysql5711/bin/mysqld(pfs_spawn_thread+0x170)[0x1cc0a3f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8182)[0x7f21dd2fd182]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f21dc80a47d]

With Optimized build:
mysql> alter table sbtest1 tablespace=t2;
ERROR 3183 (HY000): This tablespace can't be encrypted.

How to repeat:
See description

Suggested fix:
No idea.
[22 Mar 2016 10:14] MySQL Verification Team
Hello Shahriyar,

Thank you for the report.
Observed that only debug build is affected.

Thanks,
Umesh
[22 Mar 2016 10:15] MySQL Verification Team
-- with debug build

(gdb) bt
#0  0x00007f2e0dd30771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000017aa0cd in my_write_core (sig=6) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/mysys/stacktrace.c:247
#2  0x0000000000d8b058 in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f2e0c9365d7 in raise () from /lib64/libc.so.6
#5  0x00007f2e0c937cc8 in abort () from /lib64/libc.so.6
#6  0x0000000001a337a7 in ut_dbg_assertion_failed (expr=0x2211a10 "block->magic_n == MEM_BLOCK_MAGIC_N",
    file=0x2211978 "/export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/innobase/include/mem0mem.ic", line=157)
    at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/innobase/ut/ut0dbg.cc:67
#7  0x0000000001afaf7e in mem_block_validate (block=0x7f2d74011718) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/innobase/include/mem0mem.ic:157
#8  0x0000000001afb22f in mem_heap_free (heap=0x7f2d74011718) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/innobase/include/mem0mem.ic:523
#9  0x0000000001afc4c3 in dict_mem_table_free (table=0x7f2d74021170) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/innobase/dict/dict0mem.cc:224
#10 0x00000000018164b9 in create_table_info_t::create_table_def (this=0x7f2dca7eeab0)
    at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/innobase/handler/ha_innodb.cc:10044
#11 0x00000000018039e8 in create_table_info_t::create_table (this=0x7f2dca7eeab0) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/innobase/handler/ha_innodb.cc:11567
#12 0x000000000180464d in ha_innobase::create (this=0x7f2d7401fcc0, name=0x7f2dca7f0454 "./test/#sql-245e_2", form=0x7f2dca7eec00, create_info=0x7f2dca7f1c40)
    at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/innobase/handler/ha_innodb.cc:11917
#13 0x0000000000e0cc76 in handler::ha_create (this=0x7f2d7401fcc0, name=0x7f2dca7f0454 "./test/#sql-245e_2", form=0x7f2dca7eec00, info=0x7f2dca7f1c40)
    at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/handler.cc:4819
#14 0x0000000000e0d2a5 in ha_create_table (thd=0x7f2d74000b70, path=0x7f2dca7f0454 "./test/#sql-245e_2", db=0x7f2d740064b8 "test", table_name=0x7f2dca7efc00 "#sql-245e_2",
    create_info=0x7f2dca7f1c40, update_create_info=false, is_temp_table=false) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/handler.cc:4978
#15 0x00000000014f1723 in mysql_alter_table (thd=0x7f2d74000b70, new_db=0x7f2d740064b8 "test", new_name=0x0, create_info=0x7f2dca7f1c40, table_list=0x7f2d74005f30, alter_info=0x7f2dca7f1d40)
    at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/sql_table.cc:9570
#16 0x0000000001679969 in Sql_cmd_alter_table::execute (this=0x7f2d740064c8, thd=0x7f2d74000b70) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/sql_alter.cc:316
#17 0x000000000145ccfe in mysql_execute_command (thd=0x7f2d74000b70, first_level=true) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/sql_parse.cc:4806
#18 0x000000000145ec61 in mysql_parse (thd=0x7f2d74000b70, parser_state=0x7f2dca7f3690) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/sql_parse.cc:5518
#19 0x0000000001453776 in dispatch_command (thd=0x7f2d74000b70, com_data=0x7f2dca7f3e00, command=COM_QUERY)
    at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/sql_parse.cc:1428
#20 0x0000000001452631 in do_command (thd=0x7f2d74000b70) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/sql_parse.cc:996
#21 0x0000000001588c6d in handle_connection (arg=0x4ffe9b0) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/sql/conn_handler/connection_handler_per_thread.cc:301
#22 0x0000000001bc0c75 in pfs_spawn_thread (arg=0x5144bd0) at /export/home/pb2/build/sb_0-17781605-1454370718.35/mysql-5.7.11/storage/perfschema/pfs.cc:2192
#23 0x00007f2e0dd2bdf5 in start_thread () from /lib64/libpthread.so.0
#24 0x00007f2e0c9f760d in clone () from /lib64/libc.so.6
(gdb)

-- with release build seeing -ERROR 3183 (HY000): This tablespace can't be encrypted.
[6 May 2016 10:48] Erlend Dahl
Fixed in 5.7.13 along with 

Bug#80182 Unsupported extension error for new features while 'create table like'