Bug #28254 innodb crash if shutdown during innodb_table_monitor is running
Submitted: 4 May 2007 20:27 Modified: 3 Aug 2007 15:13
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.0 OS:Any
Assigned to: Inaam Rana CPU Architecture:Any
Tags: crash, innodb

[4 May 2007 20:27] Shane Bester
When you enable the innodb_table_monitor and there are many tables, the output to log file can take a few minutes.

During these minute, if you run 'mysqladmin shutdown', innodb can crash:

070504 22:22:40InnoDB: Assertion failure in thread 7276 in file .\buf\buf0buf.c line 2431
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.0/en/forcing-recovery.html
InnoDB: about forcing recovery.
InnoDB: Thread 3740 stopped in file .\sync\sync0arr.c line 123

mysqld-debug.exe!buf_all_freed()  Line 2431
mysqld-debug.exe!logs_empty_and_mark_files_at_shutdown()  Line 3182
mysqld-debug.exe!innobase_shutdown_for_mysql()  Line 1764
mysqld-debug.exe!innobase_end()  Line 1482
mysqld-debug.exe!ha_panic(ha_panic_function flag=HA_PANIC_CLOSE)  Line 525
mysqld-debug.exe!clean_up(int print_message=0x00000001)  Line 1120
mysqld-debug.exe!unireg_end()  Line 1065
mysqld-debug.exe!kill_server(int sig_ptr=0x0000000f)  Line 1014
mysqld-debug.exe!handle_shutdown(void * arg=0x00000000)  Line 2491
mysqld-debug.exe!pthread_start(void * param=0x0289b6b0)  Line 62
mysqld-debug.exe!_callthreadstart()  Line 293
mysqld-debug.exe!_threadstart(void * ptd=0x0289b6e8)  Line 277

How to repeat:
create alot of tables, with indexes and some data.

create table innodb_table_monitor(id int)engine=innodb;

wait for the outputs to start, then run 'mysqladmin shutdown'

Suggested fix:
don't crash
[7 May 2007 11:31] Heikki Tuuri

please investigate this crash.


[25 Jul 2007 18:43] Timothy Smith
Queued to 5.1-maint; please return this to "Patch approved", pending delivery of 5.0 snapshot from Innobase.
[2 Aug 2007 19:13] Bugs System
Pushed into 5.1.21-beta
[3 Aug 2007 15:13] Paul Dubois
Noted in 5.1.21 changelog.

InnoDB could crash if the server was shut down while
innodb_table_monitor was running.