Bug #88753 InnoDB: Failing assertion: *mbmaxlen < 5
Submitted: 5 Dec 2017 6:54 Modified: 6 Dec 2017 23:56
Reporter: Roel Van de Paar Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S6 (Debug Builds)
Version:5.5.58, 5.6.35 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug

[5 Dec 2017 6:54] Roel Van de Paar
Description:
171205 17:23:10 [Note] /sda/MS091117-mysql-5.5.58-linux-x86_64-debug/bin/mysqld: ready for connections.
Version: '5.5.58-debug'  socket: '/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/socket.sock'  port: 18611  MySQL Community Server (GPL)
171205 17:23:14  InnoDB: Assertion failure in thread 140074575083264 in file ha_innodb.cc line 1128
InnoDB: Failing assertion: *mbmaxlen < 5

Core was generated by `/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/bin/mysqld --no-defaults --core -'.
Program terminated with signal 6, Aborted.
#0  0x00007f65a6eae9b1 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
61	  val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
#0  0x00007f65a6eae9b1 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000007dffb8 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:433
#2  0x00000000006a2f16 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:247
#3  <signal handler called>
#4  0x00007f65a55e41f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f65a55e58e8 in __GI_abort () at abort.c:90
#6  0x00000000008502c3 in innobase_get_cset_width (cset=cset@entry=17, mbminlen=mbminlen@entry=0x7f65a749f0f8, 
    mbmaxlen=mbmaxlen@entry=0x7f65a749f0f0) at /git/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:1128
#7  0x00000000009497b3 in dtype_get_mblen (mbmaxlen=0x7f65a749f0f0, mbminlen=0x7f65a749f0f8, prtype=140073987363064, mtype=140073987550328)
    at /git/mysql-server_dbg/storage/innobase/include/data0type.ic:93
#8  dict_mem_fill_column_struct (column=0x7f6584452c78, col_pos=col_pos@entry=0, mtype=mtype@entry=12, prtype=prtype@entry=1118223, 
    col_len=col_len@entry=1280) at /git/mysql-server_dbg/storage/innobase/dict/dict0mem.c:253
#9  0x0000000000949c73 in dict_mem_table_add_col (table=0x7f65844250f8, heap=<optimized out>, name=<optimized out>, mtype=<optimized out>, 
    prtype=<optimized out>, len=<optimized out>) at /git/mysql-server_dbg/storage/innobase/dict/dict0mem.c:223
#10 0x000000000085d8a0 in create_table_def (flags=65, path_of_temp_table=<optimized out>, table_name=0x7f65a749f4c0 "data/#sql1557_2_0", 
    form=0x7f65a749fcb0, trx=0x7f6584452678) at /git/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:6656
#11 ha_innobase::create (this=<optimized out>, name=<optimized out>, form=0x7f65a749fcb0, create_info=0x7f65a74a1db0)
    at /git/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:7262
#12 0x00000000006a9ba7 in handler::ha_create (this=0x7f6584473010, 
    name=0x7f65a74a0920 "/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/data/#sql1557_2_0", form=form@entry=0x7f65a749fcb0, 
    info=info@entry=0x7f65a74a1db0) at /git/mysql-server_dbg/sql/handler.cc:3616
#13 0x00000000006a9fe0 in ha_create_table (thd=thd@entry=0x7f6597f89000, 
    path=path@entry=0x7f65a74a0920 "/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/data/#sql1557_2_0", db=db@entry=0x7f658441f660 "db1", 
    table_name=table_name@entry=0x7f658441f100 "tmp1", create_info=create_info@entry=0x7f65a74a1db0, 
    update_create_info=update_create_info@entry=false) at /git/mysql-server_dbg/sql/handler.cc:3823
#14 0x000000000062596f in rea_create_table (thd=thd@entry=0x7f6597f89000, 
    path=path@entry=0x7f65a74a0920 "/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/data/#sql1557_2_0", db=db@entry=0x7f658441f660 "db1", 
    table_name=table_name@entry=0x7f658441f100 "tmp1", create_info=create_info@entry=0x7f65a74a1db0, create_fields=..., keys=0, 
    key_info=0x7f658441f838, file=file@entry=0x7f658444e010) at /git/mysql-server_dbg/sql/unireg.cc:531
#15 0x00000000005f72de in mysql_create_table_no_lock (thd=thd@entry=0x7f6597f89000, db=0x7f658441f660 "db1", table_name=0x7f658441f100 "tmp1", 
    create_info=create_info@entry=0x7f65a74a1db0, alter_info=alter_info@entry=0x7f65a74a1880, internal_tmp_table=internal_tmp_table@entry=false, 
    select_field_count=select_field_count@entry=0, is_trans=is_trans@entry=0x7f65a74a178f) at /git/mysql-server_dbg/sql/sql_table.cc:4377
#16 0x00000000005f7809 in mysql_create_table (thd=thd@entry=0x7f6597f89000, create_table=create_table@entry=0x7f658441f138, 
    create_info=create_info@entry=0x7f65a74a1db0, alter_info=alter_info@entry=0x7f65a74a1880) at /git/mysql-server_dbg/sql/sql_table.cc:4471
#17 0x000000000058d80b in mysql_execute_command (thd=thd@entry=0x7f6597f89000) at /git/mysql-server_dbg/sql/sql_parse.cc:2635
#18 0x00000000005940f6 in mysql_parse (thd=thd@entry=0x7f6597f89000, rawbuf=<optimized out>, length=56, 
    parser_state=parser_state@entry=0x7f65a74a2580) at /git/mysql-server_dbg/sql/sql_parse.cc:5831
#19 0x00000000005959f5 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f6597f89000, 
    packet=packet@entry=0x7f6597f80001 "CREATE TEMPORARY TABLE tmp1 (a VARCHAR(256)) ENGINE=none", packet_length=packet_length@entry=56)
    at /git/mysql-server_dbg/sql/sql_parse.cc:1075
#20 0x0000000000597836 in do_command (thd=0x7f6597f89000) at /git/mysql-server_dbg/sql/sql_parse.cc:776
#21 0x000000000063fd82 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7f6597f89000) at /git/mysql-server_dbg/sql/sql_connect.cc:870
#22 0x000000000063fe3f in handle_one_connection (arg=0x7f6597f89000) at /git/mysql-server_dbg/sql/sql_connect.cc:789
#23 0x00007f65a6ea9e25 in start_thread (arg=0x7f65a74a3700) at pthread_create.c:308
#24 0x00007f65a56a734d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
CREATE DATABASE db1 COLLATE filename;
USE db1;
CREATE TEMPORARY TABLE tmp1 (a VARCHAR(256)) ENGINE=none;
[5 Dec 2017 6:54] Roel Van de Paar
May be related to https://bugs.mysql.com/bug.php?id=78732 or may be a different/new bug altogether.
[5 Dec 2017 6:56] Roel Van de Paar
(Even if it is related to the bug quotes, it is not fixed in 5.5)
[5 Dec 2017 8:16] MySQL Verification Team
Only debug server affected:

miguel@tikal:~/dbsd $ ./55c
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.60-debug Source distribution 2017-DEC-02

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 5.5 > CREATE DATABASE db1 COLLATE filename;
CREATE TEMPORARY TABLE tmp1 (a VARCHAR(256)) ENGINE=none;Query OK, 1 row affected (0.04 sec)

mysql 5.5 > USE db1;
Database changed
mysql 5.5 > CREATE TEMPORARY TABLE tmp1 (a VARCHAR(256)) ENGINE=none;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql 5.5 >

171205  6:13:20 [Note] Server socket created on IP: '0.0.0.0'.
171205  6:13:20 [Note] Event Scheduler: Loaded 0 events
171205  6:13:20 [Note] /home/miguel/dbsd/5.5/bin/mysqld: ready for connections.
Version: '5.5.60-debug'  socket: '/tmp/mysql55.sock'  port: 3355  Source distribution 2017-DEC-02
171205  6:14:14  InnoDB: Assertion failure in thread 140014597715712 in file ha_innodb.cc line 1128
InnoDB: Failing assertion: *mbmaxlen < 5
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/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
08:14:14 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.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

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

Thread pointer: 0x340abe0
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 = 7f57b05c2eb8 thread_stack 0x40000
/home/miguel/dbsd/5.5/bin/mysqld(my_print_stacktrace+0x35)[0x8ac43b]
/home/miguel/dbsd/5.5/bin/mysqld(handle_fatal_signal+0x3a0)[0x742703]
/lib64/libpthread.so.0(+0xf5e0)[0x7f57b2f5f5e0]
/lib64/libc.so.6(gsignal+0x37)[0x7f57b1b4f1f7]
/lib64/libc.so.6(abort+0x148)[0x7f57b1b508e8]
/home/miguel/dbsd/5.5/bin/mysqld[0x8bf1d8]
/home/miguel/dbsd/5.5/bin/mysqld[0x9b3503]
/home/miguel/dbsd/5.5/bin/mysqld[0x9b4556]
/home/miguel/dbsd/5.5/bin/mysqld[0x9b44a3]
/home/miguel/dbsd/5.5/bin/mysqld[0x8c752b]
/home/miguel/dbsd/5.5/bin/mysqld[0x8c83ca]
/home/miguel/dbsd/5.5/bin/mysqld(_ZN7handler9ha_createEPKcP5TABLEP24st_ha_create_information+0x46)[0x748f62]
/home/miguel/dbsd/5.5/bin/mysqld(_Z15ha_create_tableP3THDPKcS2_S2_P24st_ha_create_informationb+0x191)[0x74963b]
/home/miguel/dbsd/5.5/bin/mysqld(_Z16rea_create_tableP3THDPKcS2_S2_P24st_ha_create_informationR4ListI12Create_fieldEjP6st_keyP7handler+0x1b8)[0x6a08ae]
/home/miguel/dbsd/5.5/bin/mysqld(_Z26mysql_create_table_no_lockP3THDPKcS2_P24st_ha_create_informationP10Alter_infobjPb+0xf07)[0x669aad]
/home/miguel/dbsd/5.5/bin/mysqld(_Z18mysql_create_tableP3THDP10TABLE_LISTP24st_ha_create_informationP10Alter_info+0xc6)[0x669d84]
/home/miguel/dbsd/5.5/bin/mysqld(_Z21mysql_execute_commandP3THD+0x1831)[0x5e7e96]
/home/miguel/dbsd/5.5/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x256)[0x5f016b]
/home/miguel/dbsd/5.5/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xb98)[0x5e469b]
/home/miguel/dbsd/5.5/bin/mysqld(_Z10do_commandP3THD+0x271)[0x5e38ce]
/home/miguel/dbsd/5.5/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x170)[0x6c1958]
/home/miguel/dbsd/5.5/bin/mysqld(handle_one_connection+0x33)[0x6c1492]
/lib64/libpthread.so.0(+0x7e25)[0x7f57b2f57e25]
/lib64/libc.so.6(clone+0x6d)[0x7f57b1c1234d]
[5 Dec 2017 8:23] MySQL Verification Team
Thank you for the bug report.
[6 Dec 2017 23:56] Roel Van de Paar
5.6 Also

Version: '5.6.35-debug'  socket: '/sda/MS020217-mysql-5.6.35-linux-x86_64-debug/socket.sock'  port: 17239  MySQL Community Server (GPL)
2017-12-07 10:24:28 7f34f04c8700  InnoDB: Assertion failure in thread 139865346574080 in file ha_innodb.cc line 1725
InnoDB: Failing assertion: *mbmaxlen < 5
Core was generated by `/sda/MS020217-mysql-5.6.35-linux-x86_64-debug/bin/mysqld --no-defaults --core -'.
Program terminated with signal 6, Aborted.
#0  0x00007f34efed39b1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
61	  val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
#0  0x00007f34efed39b1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000000a9cf79 in my_write_core (sig=6) at /git/MS-5.6.35_dbg/mysys/stacktrace.c:424
#2  0x000000000072c620 in handle_fatal_signal (sig=6) at /git/MS-5.6.35_dbg/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f34ee3f31f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f34ee3f48e8 in __GI_abort () at abort.c:90
#6  0x0000000000b6ac21 in innobase_get_cset_width (cset=17, mbminlen=0x7f34f04c2ab8, mbmaxlen=0x7f34f04c2ab0)
    at /git/MS-5.6.35_dbg/storage/innobase/handler/ha_innodb.cc:1725
#7  0x0000000000d6e97e in dtype_get_mblen (mtype=13, prtype=1114366, mbminlen=0x7f34f04c2ab8, mbmaxlen=0x7f34f04c2ab0)
    at /git/MS-5.6.35_dbg/storage/innobase/include/data0type.ic:96
#8  0x0000000000d70556 in dict_mem_fill_column_struct (column=0x7f34ac090278, col_pos=0, mtype=13, prtype=1114366, col_len=5)
    at /git/MS-5.6.35_dbg/storage/innobase/dict/dict0mem.cc:493
#9  0x0000000000d6fc36 in dict_mem_table_add_col (table=0x7f34ac06baf8, heap=0x7f34ac0c9000, name=0x7f34ac07f911 "a", mtype=13, 
    prtype=1114366, len=5) at /git/MS-5.6.35_dbg/storage/innobase/dict/dict0mem.cc:262
#10 0x0000000000b765a4 in create_table_def (trx=0x7f34ac08ea78, form=0x7f34f04c3aa0, table_name=0x7f34f04c2e70 "test/#sql-240b_2", 
    temp_path=0x7f34f04c3070 "", remote_path=0x7f34f04c3270 "", flags=1, flags2=80)
    at /git/MS-5.6.35_dbg/storage/innobase/handler/ha_innodb.cc:8816
#11 0x0000000000b77ef3 in ha_innobase::create (this=0x7f34ac080010, name=0x7f34f04c57fc "./test/#sql-240b_2", form=0x7f34f04c3aa0, 
    create_info=0x7f34f04c5de0) at /git/MS-5.6.35_dbg/storage/innobase/handler/ha_innodb.cc:9732
#12 0x0000000000645ad2 in handler::ha_create (this=0x7f34ac080010, name=0x7f34f04c57fc "./test/#sql-240b_2", form=0x7f34f04c3aa0, 
    info=0x7f34f04c5de0) at /git/MS-5.6.35_dbg/sql/handler.cc:4525
#13 0x00000000006463c3 in ha_create_table (thd=0x7f34c77d0000, path=0x7f34f04c57fc "./test/#sql-240b_2", db=0x7f34ac01f690 "test", 
    table_name=0x7f34f04c4f90 "#sql-240b_2", create_info=0x7f34f04c5de0, update_create_info=false, is_temp_table=false)
    at /git/MS-5.6.35_dbg/sql/handler.cc:4769
#14 0x000000000084c99d in mysql_alter_table (thd=0x7f34c77d0000, new_db=0x7f34ac01f690 "test", new_name=0x0, 
    create_info=0x7f34f04c5de0, table_list=0x7f34ac01f130, alter_info=0x7f34f04c5d50, order_num=0, order=0x0, ignore=false)
    at /git/MS-5.6.35_dbg/sql/sql_table.cc:8598
#15 0x000000000098ae49 in Sql_cmd_alter_table::execute (this=0x7f34ac01f770, thd=0x7f34c77d0000)
    at /git/MS-5.6.35_dbg/sql/sql_alter.cc:313
#16 0x00000000007dfba2 in mysql_execute_command (thd=0x7f34c77d0000) at /git/MS-5.6.35_dbg/sql/sql_parse.cc:5023
#17 0x00000000007e2ff8 in mysql_parse (thd=0x7f34c77d0000, 
    rawbuf=0x7f34ac01f010 "ALTER TABLE t1 MODIFY a CHAR(1)CHARACTER SET filename", length=53, parser_state=0x7f34f04c7590)
    at /git/MS-5.6.35_dbg/sql/sql_parse.cc:6433
#18 0x00000000007d6110 in dispatch_command (command=COM_QUERY, thd=0x7f34c77d0000, 
    packet=0x7f34ba6eb001 "ALTER TABLE t1 MODIFY a CHAR(1)CHARACTER SET filename", packet_length=53)
    at /git/MS-5.6.35_dbg/sql/sql_parse.cc:1372
#19 0x00000000007d50d4 in do_command (thd=0x7f34c77d0000) at /git/MS-5.6.35_dbg/sql/sql_parse.cc:1039
#20 0x000000000079ca7c in do_handle_one_connection (thd_arg=0x7f34c7789000) at /git/MS-5.6.35_dbg/sql/sql_connect.cc:982
#21 0x000000000079c7ec in handle_one_connection (arg=0x7f34c7789000) at /git/MS-5.6.35_dbg/sql/sql_connect.cc:899
#22 0x0000000000ae9335 in pfs_spawn_thread (arg=0x7f34ec7f3e80) at /git/MS-5.6.35_dbg/storage/perfschema/pfs.cc:1860
#23 0x00007f34efecee25 in start_thread (arg=0x7f34f04c8700) at pthread_create.c:308
#24 0x00007f34ee4b634d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

USE test;
CREATE TABLE t1(a INT,i CHAR(1),INDEX(i(1)));
ALTER TABLE t1 MODIFY a CHAR(1)CHARACTER SET filename;