Bug #28983 'reset master' in multiple threads and innodb tables asserts debug binary
Submitted: 8 Jun 2007 18:08 Modified: 9 Jul 2007 1:01
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:5.0.44-BK, 5.0.42 OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any

[8 Jun 2007 18:08] Shane Bester
Description:
when running the following in 5 threads, debug binary crashes with assertion:

insert into t1 values (0)
reset master

t1 is an innodb table.  

Assertion failed: mysql_bin_log.is_open() && (all || !(thd->options & ((1ull << 19) | (1ull << 20)))), file .\log.cc, line 130

How to repeat:
Will upload a small testcase later.

Suggested fix:
.
[8 Jun 2007 18:11] Shane Bester
testcase, see top of file for compile, user, host, etc.

Attachment: bug28983.c (text/x-csrc), 5.62 KiB.

[8 Jun 2007 18:13] Shane Bester
i forgot to mention I started the server with option --skip-grant-tables --skip-name-resolve --log-bin --server-id=1234
[8 Jun 2007 19:45] Valeriy Kravchuk
Thank you for a bug report. Verified with a test case uploaded and latest 5.0.44-debug on Linux. I've got a lot of:

query failed 'insert into t1 values (0)' : 2006 (MySQL server has gone away)
query failed 'insert into t1 values (0)' : 2006 (MySQL server has gone away)
query failed 'reset master' : 2006 (MySQL server has gone away)
query failed 'reset master' : 2006 (MySQL server has gone away)
query failed 'reset master' : 2006 (MySQL server has gone away)
...

and each time server crashed on INSERT. Resolved stack trace:

openxs@suse:~/dbs/5.0> bin/resolve_stack_dump -s /tmp/mysqld5.sym 28983.stack
0x81a102e handle_segfault + 428
0xffffe410 _end + -141323120
0x401b6b75 _end + 934222837
0x401ae903 _end + 934189443
0x8220f57 _Z13binlog_commitP3THDb + 141
0x825af40 _Z19ha_commit_one_phaseP3THDb + 152
0x825adfd _Z15ha_commit_transP3THDb + 785
0x825b235 _Z25ha_autocommit_or_rollbackP3THDi + 77
0x820bc67 _Z12mysql_insertP3THDP13st_table_listR4ListI4ItemERS3_IS5_ES6_S6_15enu
m_duplicatesb + 2747
0x81b80bd _Z21mysql_execute_commandP3THD + 9703
0x81bd2f2 _Z11mysql_parseP3THDPKcjPS2_ + 320
0x81b4929 _Z16dispatch_command19enum_server_commandP3THDPcj + 1651
0x81b42a9 _Z10do_commandP3THD + 453
0x81b3557 handle_one_connection + 799
0x40050aa7 _end + 932756263
0x40247c2e _end + 934816942
[26 Jun 2007 10:56] Shane Bester
how I built mysqld and error log

Attachment: 5.0.46_compiled_and_error.log (application/octet-stream, text), 7.97 KiB.

[26 Jun 2007 13:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/29615

ChangeSet@1.2505, 2007-06-26 16:44:04+03:00, gkodinov@magare.gmz +1 -0
  Bug #28983: 'reset master' in multiple threads and innodb tables 
  asserts debug binary
  
  We can't reliably check if the binary log is opened without 
  acquiring its mutex. 
  Fixed by making this check conditional and off by default.
[3 Jul 2007 7:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/30152

ChangeSet@1.2505, 2007-07-03 10:36:37+03:00, gkodinov@magare.gmz +1 -0
  Bug #28983: 'reset master' in multiple threads and innodb tables 
  asserts debug binary
  
  We can't reliably check if the binary log is opened without 
  acquiring its mutex. 
  Fixed by removing this check.
[8 Jul 2007 17:29] Bugs System
Pushed into 5.1.21-beta
[8 Jul 2007 17:30] Bugs System
Pushed into 5.0.46
[9 Jul 2007 1:01] Paul Dubois
Noted in 5.0.46, 5.1.21 changelogs.

Inserting into InnoDB tables and executing RESET MASTER in multiple
threads cause assertion failure in debug server binaries.