Bug #29156 events crash server in test suite
Submitted: 16 Jun 2007 16:32 Modified: 3 Jul 2007 17:35
Reporter: Ingo Strüwing Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S1 (Critical)
Version:5.1.20 OS:Linux
Assigned to: Alexey Botchkov CPU Architecture:Any

[16 Jun 2007 16:32] Ingo Strüwing
Description:
I do not know if this is repeatable, but I want to collect post-mortem information so there is a chance to fix it anyway:

events                         [ fail ]

Errors are (from /home/mydev/mysql-5.1-axmrg/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 94: query 'select db, name, body, status, interval_field, interval_value from mysql.event' failed: 2006: MySQL server has gone away
(the last lines may be the most important ones)
Result from queries before failure can be found in /home/mydev/mysql-5.1-axmrg/mysql-test/var/log/events.log

Stopping All Servers
Restoring snapshot of databases
Saving core.10549
Saving core.8451

Backtrace from core.10549:
...
#3  <signal handler called>
#4  0x084600a2 in Event_job_data::execute (this=0x42164324, thd=0x9038f18, drop=false) at event_data_objects.cc:1991
#5  0x0845f0d9 in Event_worker_thread::run (this=0x421643bf, thd=0x9038f18, event=0x8fca6b8) at event_scheduler.cc:307
#6  0x0845f1ee in event_worker_thread (arg=0x8fca6b8) at event_scheduler.cc:257
#7  0x4004d183 in start_thread () from /lib/libpthread.so.0
#8  0x4019ca7e in clone () from /lib/libc.so.6
Frame #4 points to:
    delete thd->lex->sphead;
This is below the end: label. Here thd->lex is filled with 0xa5a5a5a5. In a debug server this does normally mean that thd->lex has been allocated but never initialized.

Backtrace from core.8451:
#0  0x400f5d86 in raise () from /lib/libc.so.6
#1  0x400f75b1 in abort () from /lib/libc.so.6
#2  0x0838a65e in ha_commit_trans (thd=0x8fc7a68, all=true) at handler.cc:721
#3  0x0828788f in end_trans (thd=0x8fc7a68, completion=COMMIT) at sql_parse.cc:554
#4  0x0828dcd3 in mysql_execute_command (thd=0x8fc7a68) at sql_parse.cc:3557
#5  0x08290b7a in mysql_parse (thd=0x8fc7a68, inBuf=0x90135a8 "COMMIT", length=6, found_semicolon=0x41793280) at sql_parse.cc:5388
#6  0x082916ab in dispatch_command (command=COM_QUERY, thd=0x8fc7a68, packet=0x900b549 "COMMIT", packet_length=7) at sql_parse.cc:909
#7  0x08292827 in do_command (thd=0x8fc7a68) at sql_parse.cc:668
#8  0x0828090e in handle_one_connection (arg=0x8fc7a68) at sql_connect.cc:1094
#9  0x4004d183 in start_thread () from /lib/libpthread.so.0
#10 0x4019ca7e in clone () from /lib/libc.so.6
Frame #2 points to:
   DBUG_EXECUTE_IF("crash_commit_before", abort(););
This looks like an intentionally provoked abort. However, apparently this core file might be a left-over of the crash_commit_before test. In this case that test needs to be changed so that it cleans up correctly.

How to repeat:
BUILD/compile-pentium-debug-max --with-debug=full
make test
[26 Jun 2007 17:08] 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/29626

ChangeSet@1.2514, 2007-06-26 19:53:45+05:00, holyfoot@mysql.com +1 -0
  Bug #29156 events crash server in test suite
  
  don't free thd->lex->sphead if we didn't do lex_start(),
  as we can have garbage there
[27 Jun 2007 8:07] 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/29673

ChangeSet@1.2514, 2007-06-27 11:06:37+05:00, holyfoot@mysql.com +3 -0
  Bug #29156 events crash server in test suite
  
  don't free thd->lex->sphead if we didn't do lex_start(),
  as we can have garbage there
[27 Jun 2007 12:38] Andrey Hristov
Approved.

When pushed please close also :
- bug#28881
- bug#28873
- bug#28924
[1 Jul 2007 19:57] Bugs System
Pushed into 5.1.21-beta
[3 Jul 2007 17:35] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.21 changelog.