Bug #31111 | --read-only crashes MySQL (events fail to load) | ||
---|---|---|---|
Submitted: | 20 Sep 2007 14:16 | Modified: | 9 Nov 2007 17:26 |
Reporter: | Domas Mituzas | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S1 (Critical) |
Version: | 5.1-bk | OS: | Any |
Assigned to: | Alexander Nozdrin | CPU Architecture: | Any |
Tags: | bfsm_2007_10_18 |
[20 Sep 2007 14:16]
Domas Mituzas
[15 Oct 2007 14:49]
Alexander Nozdrin
Thank you. It seems, the bug depends on the configuration flags. It does not appear if configured by the standard BUILD/compiled-xxx scripts.
[15 Oct 2007 14:51]
Alexander Nozdrin
BUG#30173 has been marked as a duplicate of this bug.
[16 Oct 2007 10:41]
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/35632 ChangeSet@1.2600, 2007-10-16 14:41:47+04:00, anozdrin@station. +7 -0 Patch for BUG#31111: --read-only crashes MySQL (events fail to load). There actually were several problems here: - wrong lock type was acquired before reading mysql.event table; - Security_context::master_access attribute was not properly initialized in Security_context::init(), which led to differences in behavior with and without debug configure options. - if the server failed to load events from mysql.event, it: - forgot to close the mysql.event table, that led to the coredump, described in the bug report; - did not deinitialize the replication module, that lead to memory-lost warning on exit. The patch is to fix all these problems: - Use READ-lock when loading events from the mysql.event table; - Initialize Security_context::master_access; - Close the mysql.event table in case something went wrong; - Deinitialize the replication module on exit.
[17 Oct 2007 6:05]
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/35729 ChangeSet@1.2600, 2007-10-17 10:05:50+04:00, anozdrin@station. +7 -0 Patch for BUG#31111: --read-only crashes MySQL (events fail to load). There actually were several problems here: - WRITE-lock is required to load events from the mysql.event table, but in the read-only mode an ordinary user can not acquire it; - Security_context::master_access attribute was not properly initialized in Security_context::init(), which led to differences in behavior with and without debug configure options. - if the server failed to load events from mysql.event, it: - forgot to close the mysql.event table, that led to the coredump, described in the bug report; - did not deinitialize the replication module, that lead to memory-lost warning on exit. The patch is to fix all these problems: - Use the super-user to acquire WRITE-lock on the mysql.even table; - The WRITE-lock is acquired by the event scheduler in two cases: - on initial loading of events from the database; - when an event has been executed, so its attributes should be updated. Other cases when WRITE-lock is needed for the mysql.event table happen under the user account. So, nothing should be changed there: The user is able to create/update/drop an event only if he is a super-user. - Initialize Security_context::master_access; - Close the mysql.event table in case something went wrong; - Deinitialize the replication module on exit.
[19 Oct 2007 11:27]
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/35907 ChangeSet@1.2600, 2007-10-19 15:28:42+04:00, anozdrin@station. +7 -0 Patch for BUG#31111: --read-only crashes MySQL (events fail to load). There actually were several problems here: - WRITE-lock is required to load events from the mysql.event table, but in the read-only mode an ordinary user can not acquire it; - Security_context::master_access attribute was not properly initialized in Security_context::init(), which led to differences in behavior with and without debug configure options. - if the server failed to load events from mysql.event, it forgot to close the mysql.event table, that led to the coredump, described in the bug report. The patch is to fix all these problems: - Use the super-user to acquire WRITE-lock on the mysql.even table; - The WRITE-lock is acquired by the event scheduler in two cases: - on initial loading of events from the database; - when an event has been executed, so its attributes should be updated. Other cases when WRITE-lock is needed for the mysql.event table happen under the user account. So, nothing should be changed there: The user is able to create/update/drop an event only if he is a super-user. - Initialize Security_context::master_access; - Close the mysql.event table in case something went wrong.
[19 Oct 2007 15:55]
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/35936 ChangeSet@1.2593, 2007-10-19 19:57:08+04:00, anozdrin@station. +7 -0 Patch for BUG#31111: --read-only crashes MySQL (events fail to load). There actually were several problems here: - WRITE-lock is required to load events from the mysql.event table, but in the read-only mode an ordinary user can not acquire it; - Security_context::master_access attribute was not properly initialized in Security_context::init(), which led to differences in behavior with and without debug configure options. - if the server failed to load events from mysql.event, it forgot to close the mysql.event table, that led to the coredump, described in the bug report. The patch is to fix all these problems: - Use the super-user to acquire WRITE-lock on the mysql.even table; - The WRITE-lock is acquired by the event scheduler in two cases: - on initial loading of events from the database; - when an event has been executed, so its attributes should be updated. Other cases when WRITE-lock is needed for the mysql.event table happen under the user account. So, nothing should be changed there for the read-only mode. The user is able to create/update/drop an event only if he is a super-user. - Initialize Security_context::master_access; - Close the mysql.event table in case something went wrong.
[19 Oct 2007 15:59]
Alexander Nozdrin
Pushed into 5.1-runtime.
[29 Oct 2007 22:00]
Sveta Smirnova
Bug #31660 was marked as duplicate of this one.
[7 Nov 2007 21:59]
Bugs System
Pushed into 6.0.4-alpha
[7 Nov 2007 22:01]
Bugs System
Pushed into 5.1.23-rc
[9 Nov 2007 17:26]
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 in 5.1.23 and 6.0.4 changelogs as follows: Starting the server using <option>--read-only</option> and with the Event Scheduler enabled caused it to crash. [end] Note that the Event Scheduler is OFF but not DISABLED by default. This means that, by default, the event scheduler thread runs even though no events are executed.
[14 Dec 2007 17:34]
Sveta Smirnova
Bug #33234 was marked as duplicate of this one.