Bug #81818 Mysqld crash
Submitted: 11 Jun 2016 21:09 Modified: 18 Nov 2018 10:34
Reporter: Arjan Franzen Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version: 5.7.12 OS:Ubuntu (xenial)
Assigned to: CPU Architecture:Any
Tags: docker ubuntu xenial

[11 Jun 2016 21:09] Arjan Franzen
Description:
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.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
20:09:16 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=5
max_threads=151
thread_count=5
connection_count=5
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68189 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f233c000ae0
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 = 7f23771a3e80 thread_stack 0x40000
mysqld(my_print_stacktrace+0x2c)[0xe77fec]
mysqld(handle_fatal_signal+0x459)[0x7a7019]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0)[0x7f23b7a578d0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f23b6245067]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f23b6246448]
mysqld[0x77d54d]
mysqld(_Z20btr_cur_latch_leavesP11buf_block_tRK9page_id_tRK11page_size_tmP9btr_cur_tP5mtr_t+0x8a8)[0x110a628]
mysqld(_Z27btr_cur_search_to_nth_levelP12dict_index_tmPK8dtuple_t15page_cur_mode_tmP9btr_cur_tmPKcmP5mtr_t+0x1909)[0x1115579]
mysqld(_Z27row_ins_sec_index_entry_lowmmP12dict_index_tP16mem_block_info_tS2_P8dtuple_tmP9que_thr_tb+0x47c)[0x102febc]
mysqld(_Z23row_ins_sec_index_entryP12dict_index_tP8dtuple_tP9que_thr_tb+0x29c)[0x10344fc]
mysqld(_Z12row_ins_stepP9que_thr_t+0x1ac)[0x1035ecc]
mysqld[0x1048073]
mysqld(_ZN11ha_innobase9write_rowEPh+0x197)[0xf63da7]
mysqld(_ZN7handler12ha_write_rowEPh+0x178)[0x7fa598]
mysqld(_Z12write_recordP3THDP5TABLEP9COPY_INFOS4_+0xaa)[0xdc23ba]
mysqld(_ZN14Sql_cmd_insert12mysql_insertEP3THDP10TABLE_LIST+0x948)[0xdc3b18]
mysqld(_ZN14Sql_cmd_insert7executeEP3THD+0xc2)[0xdc4272]
mysqld(_Z21mysql_execute_commandP3THDb+0x6ed)[0xc4e3ed]
mysqld(_Z11mysql_parseP3THDP12Parser_state+0x3ad)[0xc531bd]
mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0x817)[0xc53a47]
mysqld(_Z10do_commandP3THD+0x18f)[0xc54faf]
mysqld(handle_connection+0x278)[0xd108d8]
mysqld(pfs_spawn_thread+0x1b4)[0xe90784]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4)[0x7f23b7a500a4]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f23b62f887d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f233f94b2c0): INSERT INTO `stocklevels` VALUES (1,8796129001554,8939674666967,'2013-01-25 00:55:18','2013-01-25 00:55:18',NULL,0,0,0,1,0,-1,NULL,0,'5100618',8796125988821,0,0,NULL,NULL,0,8796093087754,0,8796093220856,0),(13,8796129001554,8939674699735,'2013-01-25 00:55:18','2015-01-11 02:19:31',NULL,0,0,0,1,0,-1,NULL,0,'5100631',8796125988821,0,0,NULL,NULL,2,8796093087754,0,8796093220856,0),(3,8796129001554,8939674732503,'2013-01-25 00:55:18','2014-10-07 02:52:05',NULL,0,0,0,1,0,-1,NULL,0,'5100633',8796125988821,0,0,NULL,NULL,0,8796093087754,0,8796093220856,0),(11,8796129001554,8939674765271,'2013-01-25 00:55:18','2014-05-25 00:19:38',NULL,0,0,0,1,0,-1,NULL,0,'5100634',8796125988821,0,0,NULL,NULL,0,8796093087754,0.17,8796093220856,0),(2,8796129001554,8939674798039,'2013-01-25 00:55:18','2013-01-28 02:54:43',NULL,0,0,0,1,0,-1,NULL,0,'5100658',8796125988821,0,0,NULL,NULL,0,8796093087754,1,8796093220856,0),(13,8796129001554,8939674830807,'2013-01-25 00:55:18','2013-08-18 02:48:20',NULL,0,0,0,1,0,-1,NULL,0,'5100669',8796125988
Connection ID (thread ID): 4
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.

How to repeat:
Import large table

Suggested fix:
none
[11 Jun 2016 21:10] Arjan Franzen
Full crashdump

Attachment: crash.txt (text/plain), 20.01 KiB.

[11 Jun 2016 21:16] Arjan Franzen
RecoveryFails too

Attachment: recoveryfail.txt (text/plain), 6.41 KiB.

[12 Jun 2016 11:40] Hartmut Holzgraefe
Duplicate of fixed Bug #74596?

=> https://bugs.mysql.com/74596
[15 Jun 2016 8:46] MySQL Verification Team
Hello Arjan Franzen,

Thank you for the report.
I tried to reproduce on 5.7.13(with conf, linkbench from Bug #74596) but still no sign of the crash even after running for ~12hr's.  Any chance you can provide MySQL conf file from your environment, and most importantly repeatable test case if any so that we can reproduce the issue at our end? Please mark it as private after posting here.

Thanks,
Umesh
[15 Jun 2016 14:37] Arjan Franzen
Hi, thanks for the follow-up and testing.
Essentially it's a 12Gig SQL file that consistently crashes on docker mysql:5.6 and mysql:5.7 (9Gig into the import).

I was able to restore the entire SQL using docker and the mysql:5.5 image: no crash

I'll provide the (standard) mysqlconfig that Docker uses inside the image. (5.7)
[15 Jun 2016 15:00] Arjan Franzen
my.cnf
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

#
# The MySQL Community Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

[mysqld_safe]
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
skip-host-cache
skip-name-resolve
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
explicit_defaults_for_timestamp

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address   = 127.0.0.1

#log-error      = /var/log/mysql/error.log

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
[15 Jun 2016 15:09] MySQL Verification Team
what we also need is :  SHOW CREATE TABLE stocklevels ;
[15 Jun 2016 18:40] Arjan Franzen
trusty64 MysqlDocker57 crash

Attachment: trustycrash57.json (application/octet-stream, text), 87.74 KiB.

[15 Jun 2016 19:21] Arjan Franzen
for stocklevel create table; I'm happy to send it directly, please reach out via mail (or other)

thanks
[16 Jun 2016 12:46] MySQL Verification Team
Thank you, Arjan Franzen for the conf files.
I'm still not seeing the issue with provided conf file(imho, no special settings and all defaults.) and after loading >118G data.

As my colleague Shane mentioned, we need the exact table as well. I would suggest you to post here and mark your comment as private(hide comment from public for the comment option) or alternatively, please see the other options available in http://bugs.mysql.com/bug.php?id=81818&files=1

Thanks,
Umesh
[18 Nov 2018 10:34] MySQL Verification Team
sorry, i could never repeat this in tests.  If it's still repeatable on a different system with 5.7.24 or 8.0.13, let us know