Bug #40770 | Server Crash when running with triggers including variable settings (rpl_sys) | ||
---|---|---|---|
Submitted: | 17 Nov 2008 3:25 | Modified: | 9 Dec 2008 0:22 |
Reporter: | Omer Barnir (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S2 (Serious) |
Version: | 5.1.29, 5.1.30 | OS: | Linux (64bit / All OS)) |
Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
Tags: | regression |
[17 Nov 2008 3:25]
Omer Barnir
[17 Nov 2008 3:26]
Omer Barnir
Files needed to reproduce the crash
Attachment: bug_files.tar.gz (application/x-gzip, text), 10.82 KiB.
[17 Nov 2008 6:22]
Lars Thalmann
From the stack trace, this crash seems to happens in the server code. Reassigning to Joro.
[17 Nov 2008 7:54]
Ramil Kalimullin
Couldn't repeat on my 32-bit Linux box: 2.6.27.5-109.fc10.i686 #1 SMP Thu Nov 13 21:01:50 EST 2008 i686 i686 i386 GNU/Linux
[17 Nov 2008 15:46]
Elena Stepanova
Reproduced on qa-srv-b box () on 5.1.29-rc binaries from mysql-advanced-5.1.29-rclinux-i686-glibc23.tar.gz.
[17 Nov 2008 16:31]
Omer Barnir
Was able to reproduce with 32-bit binaries for 5.1.30 (mysql-enterprise-commercial-advanced-5.1.30-linux-i686-glibc23.tar.gz) - both with 'mysqld' and 'mysqld-debug' (tested on Linux Suse 10.3 (VM)
[17 Nov 2008 23:06]
Elena Stepanova
During further experiments the problem was reproduced on Sparc Solaris 11 box (Sparc Solaris 10 binaries mysql-enterprise-commercial-advanced-5.1.30-solaris10-sparc-64bit.tar.gz). For building binaries from the tree, a 'good' build to reproduce the bug seems to be compile-pentium-max.
[18 Nov 2008 1:12]
Omer Barnir
Further investigation of the issue shows that the 'crashing factor' is related to the trigger definitions used in the test case and not to the fact that the server is set to SBR replication (the triggers are defined differently in the case of SBR and RBR/MBR as they include functions USER() and NOW(). In the case of SBR the trigers include: SET @local_user_bd:= "rpl_sys_user@localhost"; SET @local_time_bd:= NOW(); INSERT INTO test.insdel2_tracker VALUES (NULL, @local_time_bd, @local_user_bd); In the case of RBR/MBR the local variables are not used and the triggers include: INSERT INTO test.insdel2_tracker VALUES (NULL, NOW(), USER()); Running with the 'SBR' trigger definition when logging is RBR/MBR does not crash Running without the trigger definition when logging is SBR does not crash So the crash is related to the variable definition in the triggers. Updating synopsis from "Server Crash (master) when running SBR replication with TPCB scenario (rpl_sys)" to "Server Crash (master) when running with triggers including variable settings (rpl_sys)"
[19 Nov 2008 5:09]
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/59155 2716 Ramil Kalimullin 2008-11-19 Fix for bug#40770: Server Crash when running with triggers including variable settings (rpl_sys) Problem: under certain conditions (e.g. user variables usage in triggers) accessing a user defined variable we may use a variables hash table that belongs to already deleted thread. It happens if thd= new THD; has the same address as just deleted thd as we use if (stored_thd == thd) to check. That may lead to unpredictable results, server crash etc. Fix: use thread_id instead of thd address to distinguish threads. Note: no simple and repeatable test case.
[20 Nov 2008 11:26]
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/59358 2721 Ramil Kalimullin 2008-11-20 Fix for bug#40770: Server Crash when running with triggers including variable settings (rpl_sys) Problem: under certain conditions (e.g. user variables usage in triggers) accessing a user defined variable we may use a variables hash table that belongs to already deleted thread. It happens if thd= new THD; has the same address as just deleted thd as we use if (stored_thd == thd) to check. That may lead to unpredictable results, server crash etc. Fix: use thread_id instead of thd address to distinguish threads. Note: no simple and repeatable test case.
[8 Dec 2008 10:23]
Bugs System
Pushed into 5.1.31 (revid:ramil@mysql.com-20081120112526-6nyxavhtzt9npthm) (version source revid:patrick.crews@sun.com-20081126180318-v685u61mpgoc176x) (pib:5)
[8 Dec 2008 11:34]
Bugs System
Pushed into 6.0.9-alpha (revid:ramil@mysql.com-20081120112526-6nyxavhtzt9npthm) (version source revid:ingo.struewing@sun.com-20081121151447-dtf2ofz2ys0zqed1) (pib:5)
[9 Dec 2008 0:22]
Paul DuBois
Noted in 5.1.31, 6.0.9 changelog. Accessing user variables within triggers could cause a server crash.
[19 Jan 2009 11:34]
Bugs System
Pushed into 5.1.31-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090119095303-uwwvxiibtr38djii) (version source revid:tomas.ulin@sun.com-20090108105244-8opp3i85jw0uj5ib) (merge vers: 5.1.31-ndb-6.2.17) (pib:6)
[19 Jan 2009 13:10]
Bugs System
Pushed into 5.1.31-ndb-6.3.21 (revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (version source revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (merge vers: 5.1.31-ndb-6.3.21) (pib:6)
[19 Jan 2009 16:16]
Bugs System
Pushed into 5.1.31-ndb-6.4.1 (revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (version source revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (merge vers: 5.1.31-ndb-6.4.1) (pib:6)