Bug #54989 | With null_audit installed, server hangs on an attempt to install a plugin twice | ||
---|---|---|---|
Submitted: | 4 Jul 2010 18:38 | Modified: | 2 Sep 2010 16:11 |
Reporter: | Elena Stepanova | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.5.5-m3 | OS: | Any |
Assigned to: | Sergey Vojtovich | CPU Architecture: | Any |
Tags: | audit, plugin |
[4 Jul 2010 18:38]
Elena Stepanova
[20 Aug 2010 9:53]
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/116354 3186 Sergey Vojtovich 2010-08-20 BUG#54989 - With null_audit installed, server hangs on an attempt to install a plugin twice Server crashes when [UN]INSTALL PLUGIN fails (returns an error) and general log is disabled and there are audit plugins interested in MYSQL_AUDIT_GENERAL_CLASS. When audit event is triggered, audit subsystem acquires interested plugins by walking through plugin list. Evidently plugin list iterator protects plugin list by acquiring LOCK_plugin, see plugin_foreach_with_mask(). On the other hand [UN]INSTALL PLUGIN is acquiring LOCK_plugin rather for a long time. When audit event is triggered during [UN]INSTALL PLUGIN, plugin list iterator acquires the same lock (within the same thread) second time. Repeatable only with general_log disabled, because general_log triggers MYSQL_AUDIT_GENERAL_LOG event, which acquires audit plugins before [UN]INSTALL PLUGIN acquired LOCK_plugin. With this fix we pre-acquire audit plugins for events that may potentially occur during [UN]INSTALL PLUGIN. This hack should be removed when LOCK_plugin is fixed so it protects only what it supposed to protect. No test case for this fix - we do not have facility to test audit plugins yet. @ sql/sql_audit.cc Move "acquire audit plugin" logics to a separate function. @ sql/sql_audit.h Move "acquire audit plugin" logics to a separate function. @ sql/sql_plugin.cc Pre-acquire audit plugins for events that may potentially occur during [UN]INSTALL PLUGIN.
[23 Aug 2010 9:32]
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/116476 3191 Sergey Vojtovich 2010-08-23 [merge] Merge fix for BUG#54989 to mysql-5.5-bugfixing.
[25 Aug 2010 9:21]
Bugs System
Pushed into mysql-5.5 5.5.6-m3 (revid:alik@ibmvm-20100825092002-2yvkb3iwu43ycpnm) (version source revid:alik@ibmvm-20100825092002-2yvkb3iwu43ycpnm) (merge vers: 5.5.6-m3) (pib:20)
[27 Aug 2010 20:09]
Paul DuBois
Noted in 5.5.6 changelog. If audit plugins were installed that were interested in MYSQL_AUDIT_GENERAL_CLASS events and the general query log was disabled, failed INSTALL PLUGIN or UNINSTALL PLUGIN statements caused a server crash. Setting report to Need Merge pending push to 5.6.x.
[30 Aug 2010 8:29]
Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@sun.com-20100830082732-n2eyijnv86exc5ci) (version source revid:alik@sun.com-20100830082732-n2eyijnv86exc5ci) (merge vers: 5.6.1-m4) (pib:21)
[30 Aug 2010 8:33]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100830082745-n6sh01wlwh3itasv) (version source revid:alik@sun.com-20100830082745-n6sh01wlwh3itasv) (pib:21)
[30 Aug 2010 18:25]
Paul DuBois
Noted in 5.6.1 changelog.