Bug #80901 Assertion `m_listener == listener || m_listener == __null' failed
Submitted: 30 Mar 2016 7:14 Modified: 30 Mar 2016 8:15
Reporter: Ramesh Sivaraman (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7.11 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug

[30 Mar 2016 7:14] Ramesh Sivaraman
Description:
Error Info

2016-03-30T07:08:33.380848Z 0 [ERROR] Event scheduler: Failed to start scheduler, Can not create thread for event scheduler (errno=11)
mysqld: /sda/ps57/mysql-server_dbg/sql/rpl_context.cc:175: void Session_consistency_gtids_ctx::unregister_ctx_change_listener(Session_consistency_gtids_ctx::Ctx_change_listener*): Assertion `m_listener == listener || m_listener == __null' failed.
07:08:33 UTC - mysqld got signal 6 ;

GDB info

#0  0x00007f51c67d1771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x000000000180fa8c in my_write_core (sig=6) at /sda/ps57/mysql-server_dbg/mysys/stacktrace.c:247
#2  0x0000000000e6af64 in handle_fatal_signal (sig=6) at /sda/ps57/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f51c495d5c9 in raise () from /lib64/libc.so.6
#5  0x00007f51c495ecd8 in abort () from /lib64/libc.so.6
#6  0x00007f51c4956536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f51c49565e2 in __assert_fail () from /lib64/libc.so.6
#8  0x000000000179d25d in Session_consistency_gtids_ctx::unregister_ctx_change_listener (this=0x7f51933f2298, listener=0x7f51913ff890) at /sda/ps57/mysql-server_dbg/sql/rpl_context.cc:175
#9  0x00000000014225ce in Session_gtids_tracker::~Session_gtids_tracker (this=0x7f51913ff880, __in_chrg=<optimized out>) at /sda/ps57/mysql-server_dbg/sql/session_tracker.cc:357
#10 0x0000000001422664 in Session_gtids_tracker::~Session_gtids_tracker (this=0x7f51913ff880, __in_chrg=<optimized out>) at /sda/ps57/mysql-server_dbg/sql/session_tracker.cc:360
#11 0x000000000148d9ff in Session_tracker::deinit (this=0x7f5193ffc668) at /sda/ps57/mysql-server_dbg/sql/session_tracker.h:169
#12 0x0000000001484f07 in THD::cleanup (this=0x7f5193ff9000) at /sda/ps57/mysql-server_dbg/sql/sql_class.cc:1820
#13 0x0000000001485177 in THD::release_resources (this=0x7f5193ff9000) at /sda/ps57/mysql-server_dbg/sql/sql_class.cc:1869
#14 0x0000000001485394 in THD::~THD (this=0x7f5193ff9000, __in_chrg=<optimized out>) at /sda/ps57/mysql-server_dbg/sql/sql_class.cc:1913
#15 0x0000000001485ad2 in THD::~THD (this=0x7f5193ff9000, __in_chrg=<optimized out>) at /sda/ps57/mysql-server_dbg/sql/sql_class.cc:1960
#16 0x00000000017294ae in Event_scheduler::start (this=0x7f51923f3d00, err_no=0x7fff8f99a69c) at /sda/ps57/mysql-server_dbg/sql/event_scheduler.cc:475
#17 0x000000000161adb0 in Events::init (opt_noacl_or_bootstrap=0 '\000') at /sda/ps57/mysql-server_dbg/sql/events.cc:924
#18 0x0000000000e5be19 in mysqld_main (argc=13, argv=0x7f51c281e900) at /sda/ps57/mysql-server_dbg/sql/mysqld.cc:4870
#19 0x0000000000e534f0 in main (argc=13, argv=0x7fff8f99acf8) at /sda/ps57/mysql-server_dbg/sql/main.cc:25

How to repeat:
Testcase

Server is crashing when we start the daemon with following startup options

--thread-stack=1125899906842624 --session-track-gtids=1 --event-scheduler=ON
[30 Mar 2016 8:15] MySQL Verification Team
Hello Ramesh,

Thank you for the report.
Observed that release/debug affected.

Thanks,
Umesh