Bug #107053 Restart of mysql unexpectedly
Submitted: 19 Apr 12:54 Modified: 30 May 11:53
Reporter: Narayana reddy Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.7.34 OS:Ubuntu (16.04.1 LTS (Xenial Xerus))
Assigned to: CPU Architecture:x86 (x86_64)
Tags: assertion failure, signal 6

[19 Apr 12:54] Narayana reddy
Description:
mysql is restarting on its own. mysql came up after 1min and 28 secs. This is a production server and the restart resulted in a loss of business service.

The following errors are seen in mysql error log.
2022-04-18 09:40:02 0x7efedff3c700  InnoDB: Assertion failure in thread 139633144088320 in file trx0trx.cc line 2317
InnoDB: Failing assertion: trx->lock.n_active_thrs == 1
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.
09:40:02 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=1048576
read_buffer_size=131072
max_used_connections=135
max_threads=500
thread_count=101
connection_count=101
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 199719 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7efc9801dff0
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 = 7efedff3be70 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x3b)[0xeb606b]
/usr/sbin/mysqld(handle_fatal_signal+0x36f)[0x7b687f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f0ee6b6b390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f0ee5f24438]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f0ee5f2603a]
/usr/sbin/mysqld[0x78bd7a]
/usr/sbin/mysqld(_Z30trx_commit_or_rollback_prepareP5trx_t+0xa0)[0x11ea520]
/usr/sbin/mysqld(_Z17trx_rollback_stepP9que_thr_t+0x149)[0x11d10b9]
/usr/sbin/mysqld(_Z15que_run_threadsP9que_thr_t+0xa91)[0x110eba1]
/usr/sbin/mysqld[0x11d2e6a]
/usr/sbin/mysqld(_Z25trx_rollback_to_savepointP5trx_tP12trx_savept_t+0x22)[0x11d3122]
/usr/sbin/mysqld(_Z23row_mysql_handle_errorsP7dberr_tP5trx_tP9que_thr_tP12trx_savept_t+0x88)[0x1148f28]
/usr/sbin/mysqld[0x114972b]
/usr/sbin/mysqld(_ZN11ha_innobase9write_rowEPh+0x13d)[0x105c80d]
/usr/sbin/mysqld(_ZN7handler12ha_write_rowEPh+0x198)[0x8151e8]
/usr/sbin/mysqld(_Z12write_recordP3THDP5TABLEP9COPY_INFOS4_+0x19b)[0xdef4cb]
/usr/sbin/mysqld(_ZN14Sql_cmd_insert12mysql_insertEP3THDP10TABLE_LIST+0x8ed)[0xdf125d]
/usr/sbin/mysqld(_ZN14Sql_cmd_insert7executeEP3THD+0xea)[0xdf1fea]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THDb+0x2165)[0xc69fb5]
/usr/sbin/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x3fd)[0xc6ee4d]
/usr/sbin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0x11bd)[0xc700cd]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x1c7)[0xc71587]
/usr/sbin/mysqld(handle_connection+0x288)[0xd35a18]
/usr/sbin/mysqld(pfs_spawn_thread+0x1b4)[0x13a49d4]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f0ee6b616ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f0ee5ff651d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7efc982da1a0): is an invalid pointer
Connection ID (thread ID): 1590872
Status: NOT_KILLED

How to repeat:
We are not able to find a pattern when this restart is occurring. 

Suggested fix:
no known fix. mysql restarts automatically.
[19 Apr 13:10] MySQL Verification Team
Bug #107054 marked as duplicate of this one
[27 Apr 13:10] MySQL Verification Team
Hi Mr. reddy,

Thank you for your bug report.

You have got a controlled assertion in the InnoDB SE. This is due to the fact that a tablespace was corrupted and InnoDB could not write new data into the corrupted file.

We can further process your report solely if we can repeat both, the corruption and the exact assert. Hence, we require a fully repeatable test cases for the corruption and for the assert. Do note that corruption can happen due to bad hardware or unstable OS.

We are waiting on your fully repeatable test cases.
[28 May 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[30 May 11:53] MySQL Verification Team
Closed as "Can't repeat", since there is no adequate test case.