Bug #75572 MySQL crashes on create user command after forgetting mysql_upgrade
Submitted: 21 Jan 2015 9:22 Modified: 21 Jan 2015 10:06
Reporter: Oli Sennhauser Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S3 (Non-critical)
Version:5.6.22 enterprise OS:Linux (SLES12)
Assigned to: CPU Architecture:Any
Tags: crash, create user, MySQL

[21 Jan 2015 9:22] Oli Sennhauser
Description:
MySQL Enterprise crashes on create user command when old mysql 5.1 mysql schema is used.

How to repeat:
dump mysql 5.1
restore in 5.6 enterprise (we forgot to run mysql_upgrade)
then create user:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 894
Server version: 5.6.22-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)
 
Copyright (c) 2000, 2014, 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.
 
root@localhost [(none)]> create user 'repSlave'@'192.168.203.164' identified by 'secret';
ERROR 2013 (HY000): Lost connection to MySQL server during query
root@localhost [(none)]>

08:28:16 UTC - mysqld got signal 11 ;
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=536870912
read_buffer_size=131072
max_used_connections=5
max_threads=151
thread_count=6
connection_count=4
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 854933 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x3493bfd0
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 = 7f4dbcec6e98 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x944635]
/usr/sbin/mysqld(handle_fatal_signal+0x3f1)[0x6b51b1]
/lib64/libpthread.so.0(+0xf890)[0x7f55e001e890]
/usr/sbin/mysqld[0x6ddf57]
/usr/sbin/mysqld(_Z17mysql_create_userP3THDR4ListI11st_lex_userE+0x39f)[0x6e013f]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x2c73)[0x73af43]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x3a5)[0x73d515]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1704)[0x73f414]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x11f)[0x70925f]
/usr/sbin/mysqld(handle_one_connection+0x45)[0x709335]
/usr/sbin/mysqld(pfs_spawn_thread+0x126)[0x9db8f6]
/lib64/libpthread.so.0(+0x80a4)[0x7f55e00170a4]
/lib64/libc.so.6(clone+0x6d)[0x7f55dece37fd]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f4d84004be0): is an invalid pointer
Connection ID (thread ID): 318
Status: NOT_KILLED
 
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
150121 09:28:17 mysqld_safe Number of processes running now: 0
150121 09:28:17 mysqld_safe mysqld restarted
2015-01-21 09:28:17 0 [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --slow-query-log is not set
2015-01-21 09:28:17 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-01-21 09:28:17 29762 [Note] Plugin 'FEDERATED' is disabled.
2015-01-21 09:28:17 29762 [ERROR] Function 'ARCHIVE' already exists
2015-01-21 09:28:17 29762 [Warning] Couldn't load plugin named 'ARCHIVE' with soname 'ha_archive.so'.
2015-01-21 09:28:17 29762 [ERROR] Function 'FEDERATED' already exists
2015-01-21 09:28:17 29762 [Warning] Couldn't load plugin named 'FEDERATED' with soname 'ha_federated.so'.
2015-01-21 09:28:17 29762 [ERROR] Function 'BLACKHOLE' already exists
2015-01-21 09:28:17 29762 [Warning] Couldn't load plugin named 'BLACKHOLE' with soname 'ha_blackhole.so'.
2015-01-21 09:28:17 29762 [ERROR] Can't open shared library '/usr/lib64/mysql/plugin/ha_example.so' (errno: 0 /usr/lib64/mysql/plugin/ha_example.so: cannot open shared object file: No such file or directory)
2015-01-21 09:28:17 29762 [Warning] Couldn't load plugin named 'EXAMPLE' with soname 'ha_example.so'.
2015-01-21 09:28:17 29762 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-21 09:28:17 29762 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-21 09:28:17 29762 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-21 09:28:17 29762 [Note] InnoDB: Memory barrier is not used
2015-01-21 09:28:17 29762 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-01-21 09:28:17 29762 [Note] InnoDB: Using Linux native AIO
2015-01-21 09:28:17 29762 [Note] InnoDB: Using CPU crc32 instructions
2015-01-21 09:28:17 29762 [Note] InnoDB: Initializing buffer pool, size = 30.0G
2015-01-21 09:28:18 29762 [Note] InnoDB: Completed initialization of buffer pool
2015-01-21 09:28:18 29762 [Note] InnoDB: Highest supported file format is Barracuda.
2015-01-21 09:28:18 29762 [Note] InnoDB: The log sequence numbers 87977865684 and 87977865684 in ibdata files do not match the log sequence number 87977865750 in the ib_logfiles!
2015-01-21 09:28:18 29762 [Note] InnoDB: Database was not shutdown normally!
2015-01-21 09:28:18 29762 [Note] InnoDB: Starting crash recovery.
2015-01-21 09:28:18 29762 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-01-21 09:28:19 29762 [Note] InnoDB: Restoring possible half-written data pages
2015-01-21 09:28:19 29762 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 7191426, file name mysql-bin.000126
2015-01-21 09:28:19 29762 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-21 09:28:19 29762 [Note] InnoDB: Waiting for purge to start
2015-01-21 09:28:19 29762 [Note] InnoDB: 5.6.22 started; log sequence number 87977865750
2015-01-21 09:28:19 29762 [Note] Recovering after a crash using /mysqldisk/binarylog/mysql-bin
2015-01-21 09:28:20 29762 [Note] Starting crash recovery...
2015-01-21 09:28:20 29762 [Note] Crash recovery finished.
2015-01-21 09:28:20 29762 [Note] RSA private key file not found: /mysqlflash/data//private_key.pem. Some authentication plugins will not work.
2015-01-21 09:28:20 29762 [Note] RSA public key file not found: /mysqlflash/data//public_key.pem. Some authentication plugins will not work.
2015-01-21 09:28:20 29762 [Note] Server hostname (bind-address): '*'; port: 3306
2015-01-21 09:28:20 29762 [Note] IPv6 is available.
2015-01-21 09:28:20 29762 [Note]   - '::' resolves to '::';
2015-01-21 09:28:20 29762 [Note] Server socket created on IP: '::'.
2015-01-21 09:28:20 29762 [Warning] 'user' entry 'root@linu-8ufi.dns-kruse' ignored in --skip-name-resolve mode.
2015-01-21 09:28:20 29762 [Warning] 'user' entry '@linux-8ufi.dns-kruse' ignored in --skip-name-resolve mode.
2015-01-21 09:28:20 29762 [Warning] 'proxies_priv' entry '@ root@linux-2wv6' ignored in --skip-name-resolve mode.
2015-01-21 09:28:20 29762 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=icosmaster01-elay-bin' to avoid this problem.
2015-01-21 09:28:20 29762 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection ptions for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2015-01-21 09:28:20 29762 [Warning] Slave SQL: If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0
2015-01-21 09:28:20 29762 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000023' at position 318817857, relay log './icosmaster01-relay-bin.000005' position: 106459134
2015-01-21 09:28:20 29762 [Note] Event Scheduler: Loaded 0 events
2015-01-21 09:28:20 29762 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.22-enterprise-commercial-advanced-log'  socket: '/var/run/mysqld/mysql.sock'  port: 3306  MySQL Enterprise Server - Advanced Edition (Commercial)
2015-01-21 09:28:20 29762 [Note] Slave I/O thread: connected to master 'repSlave@192.168.101.25:3306',replication started in log 'mysql-bin.000023' at position 318817857
2015-01-21 09:28:21 29762 [Warning] Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error: Unknown system variable 'binlog_checksum', Error_code: 1193
2015-01-21 09:28:21 29762 [Warning] Slave I/O: Unknown system variable 'SERVER_UUID' on master. A probable cause is that the variable is not supported on the master (version: 5.1.46-log), even though it is on the slave version: 5.6.22-enterprise-commercial-advanced-log), Error_code: 1193
2015-01-21 09:28:22 29762 [ERROR] /usr/sbin/mysqld: Table './dboLeer/Budget_PublikZiel' is marked as crashed and should be repaired
2015-01-21 09:28:22 29762 [Warning] Checking table:   './dboLeer/Budget_PublikZiel'
2015-01-21 09:28:22 29762 [ERROR] 1 client is using or hasn't closed the table properly
 

Suggested fix:
* First of all mysql should NEVER crash on such a problem.
* Second: It would be nice if mysql detects that we are running on a wrong/old mysql schema an complain.
We just forgot to run mysql_upgrade because it was not on our checklist.
[21 Jan 2015 10:06] MySQL Verification Team
Hello Oli,

Thank you for the report.
This is duplicate of Shane's internal BUG(Enhancement) BUG 16343542 - 5.6 CRASHES WHEN READING ANCIENT SYSTEM TABLES

Thanks,
Umesh