Bug #70776 semi-sync may segfault when turned off
Submitted: 30 Oct 2013 19:18 Modified: 2 Dec 2013 14:17
Reporter: Santosh Praneeth Banda Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:mysql 5.7.2 OS:Any
Assigned to: CPU Architecture:Any

[30 Oct 2013 19:18] Santosh Praneeth Banda
Description:
Semi-sync segfaults in this scenario

1) Thread 1 doing a commit in commitTrx() releases LOCK_binlog_ in wait_result = cond_timewait(&abstime);
2) Thread 2 taking the LOCK_binlog_ turns off semi-sync deleting active_tranxs_.
3) Thread 1 in commitTrx() does an assert after the cond_timewait().  assert(!active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name,
                                             trx_wait_binlog_pos));

Thread 1 hits segfault

How to repeat:
1) run mysqlslap with 100 connections on a semi-sync enabled master replicating to a semi-sync enabled slave
2) Turns OFF semi-sync using "set global rpl_semi_sync_master_enabled=OFF"

Suggested fix:
check for NULL before assert
[31 Oct 2013 9:23] MySQL Verification Team
Hello Santosh,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[2 Dec 2013 14:17] Erlend Dahl
Duplicate of bug#70045, which has been fixed in 5.5.35, 5.6.15, 5.7.3.