| Bug #40757 | server crash after failed plugin/engine initialization | ||
|---|---|---|---|
| Submitted: | 15 Nov 2008 0:36 | Modified: | 14 Mar 2:34 |
| Reporter: | Alexey Stroganov | ||
| Status: | Closed | ||
| Category: | Server | Severity: | S3 (Non-critical) |
| Version: | 5.1.30-win64 | OS: | Any |
| Assigned to: | Ramil Kalimullin | Target Version: | 5.1+ |
| Triage: | Triaged: D1 (Critical) | ||
[15 Nov 2008 0:36]
Alexey Stroganov
[15 Nov 2008 0:55]
Alexey Stroganov
Actually it crashes with any value of this parameter except ones that are expected
[15 Nov 2008 1:03]
Alexey Stroganov
Just checked it works ok for 5.0.70 and crashes for 5.1.29
[15 Nov 2008 1:23]
Alexey Stroganov
Just checked - it works ok in 5.1.27 and 5.1.28. Also adding below snippet from documentation: ... On Windows, the flush method is always async_unbuffered and cannot be changed. ...
[17 Nov 2008 10:19]
Olav Sandstaa
Note that there is a bug report for 6.0.8 with a very similar crash, see bug #40766 "mysqld crashes if Falcon is started with non-existing serial log directory". The crash looks very similar but happens with Falcon and without InnoDB being included in the binaries.
[18 Nov 2008 2:25]
Calvin Sun
The crash is caused by the fix of bug#37958, specifically the reuse of plugin slot.
[18 Nov 2008 8:55]
Calvin Sun
From the error log, the InnoDB clearly identifies the invalid option value, and returns
error to the server:
InnoDB: Unrecognized value O_DIRECT for innodb_flush_method
081117 18:38:28 [ERROR] Plugin 'InnoDB' init function returned error.
081117 18:38:28 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
It works fine after taking the following new code out:
--- a/sql/handler.cc 2008-09-05 15:21:59 +0000
+++ b/sql/handler.cc 2008-09-29 10:34:07 +0000
@@ -373,6 +373,10 @@ int ha_finalize_handlerton(st_plugin_int
handlerton *hton= (handlerton *)plugin->data;
DBUG_ENTER("ha_finalize_handlerton");
+ /* hton can be NULL here, if ha_initialize_handlerton() failed. */
+ if (!hton)
+ goto end;
+
switch (hton->state)
{
case SHOW_OPTION_NO:
@@ -401,8 +405,16 @@ int ha_finalize_handlerton(st_plugin_int
}
}
+ /*
+ In case a plugin is uninstalled and re-installed later, it should
+ reuse an array slot. Otherwise the number of uninstall/install
+ cycles would be limited.
+ */
+ hton2plugin[hton->slot]= NULL;
+
my_free((uchar*)hton, MYF(0));
+ end:
DBUG_RETURN(0);
}
[29 Jan 18:04]
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/64543 2750 Ramil Kalimullin 2009-01-29 Fix for bug #40757: Starting server on Windows with innodb_flush_method=wrong_value causes crash Problem: failed plugin initialization (e.g. due to improper parameters) may result in server crash. Fix: clean-up plugin related data if initialization failed.
[31 Jan 17:24]
Miguel Solorzano
Bug: http://bugs.mysql.com/bug.php?id=42302 marked as duplicate of this one.
[10 Feb 9:38]
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/65700 2796 Ramil Kalimullin 2009-02-10 Fix for bug #40757: Starting server on Windows with innodb_flush_method=wrong_value causes crash Problem: after a failed plugin initialization, incompletely initialized data remained in the plugin and handlerton data structures. These were used later and caused the crash. Fix: clean-up plugin related data if initialization failed. Note: no test case added, hand tested.
[10 Feb 10:21]
Ingo Strüwing
Good patch. Approved.
[19 Feb 14:04]
Bugs System
Pushed into 6.0.10-alpha (revid:sergey.glukhov@sun.com-20090218125737-5y5b2xo3duo1wlvo) (version source revid:ramil@mysql.com-20090214140225-jm5lf0aj24so3h8d) (merge vers: 6.0.10-alpha) (pib:6)
[27 Feb 21:45]
Paul DuBois
Noted in 6.0.10 changelog. On Windows, starting the server with an invalid value for innodb_flush_method caused a crash. Setting report to NDI pending push into 5.1.x.
[13 Mar 20:06]
Bugs System
Pushed into 5.1.33 (revid:joro@sun.com-20090313111355-7bsi1hgkvrg8pdds) (version source revid:vvaintroub@mysql.com-20090218093153-sjzxf01i4ezte0xp) (merge vers: 5.1.33) (pib:6)
[14 Mar 2:34]
Paul DuBois
Noted in 5.1.33 changelog.
[25 Mar 7:46]
Sveta Smirnova
Bug #43845 was marked as duplicate of this one.
[9 May 18:45]
Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (version source revid:jonas@mysql.com-20090508100057-30ote4xggi4nq14v) (merge vers: 5.1.33-ndb-6.2.18) (pib:6)
[9 May 19:42]
Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (version source revid:jonas@mysql.com-20090508175813-s6yele2z3oh6o99z) (merge vers: 5.1.33-ndb-6.3.25) (pib:6)
[9 May 20:39]
Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (version source revid:jonas@mysql.com-20090509073226-09bljakh9eppogec) (merge vers: 5.1.33-ndb-7.0.6) (pib:6)
