Bug #37318 slave crash in replicated 'flush tables'
Submitted: 10 Jun 2008 22:17 Modified: 17 Jun 2008 8:29
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.1.26 OS:Any
Assigned to: CPU Architecture:Any

[10 Jun 2008 22:17] Shane Bester
Description:
During some tests with 5.1.26 master and slave, the slave crashed with stack trace after "flush tables" got replicated to it from the master:

mysqld.exe!mysql_lock_merge
mysqld.exe!reopen_tables
mysqld.exe!close_cached_tables
mysqld.exe!reload_acl_and_cache
mysqld.exe!mysql_execute_command
mysqld.exe!mysql_parse
mysqld.exe!Query_log_event::do_apply_event
mysqld.exe!Query_log_event::do_apply_event
mysqld.exe!Log_event::apply_event
mysqld.exe!apply_event_and_update_pos
mysqld.exe!exec_relay_log_event
mysqld.exe!handle_slave_sql
mysqld.exe!pthread_start
mysqld.exe!_callthreadstart
mysqld.exe!_threadstart

please see attachment for full stack trace from debugger.

How to repeat:
will upload a testcase.
[10 Jun 2008 22:22] MySQL Verification Team
start master with --binlog_format=row --server-id=1 --log-bin
start slave and make sure replication works.
compile and run the attached program against the slave.
wait for a slave to crash.
[10 Jun 2008 22:23] MySQL Verification Team
testcase

Attachment: bug37318.c (text/plain), 9.81 KiB.

[10 Jun 2008 22:30] MySQL Verification Team
spot the null pointer being dereferenced

Attachment: bug37318_debugger_output.txt (text/plain), 2.68 KiB.

[12 Jun 2008 17:54] MySQL Verification Team
small correction: of course run the testcase against the master :)