[MDEV-6582] DEBUG_SYNC does not reset mysys_var->current_mutex, causes assertion "Trying to unlock mutex that wasn't locked" Created: 2014-08-14 Updated: 2014-12-01 Resolved: 2014-11-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Tests |
| Affects Version/s: | 10.0.13 |
| Fix Version/s: | 10.0.16 |
| Type: | Bug | Priority: | Major |
| Reporter: | Kristian Nielsen | Assignee: | Kristian Nielsen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
https://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/5937 rpl_parallel.test asserts with the following stack trace:
I think I have seen similar failures before. I guess it happens because I also think that in THD::awake, we should take a local copy of But we could add a debug assertion that the value does not change, to try and |
| Comments |
| Comment by Kristian Nielsen [ 2014-11-26 ] | |||||||||||||||||||||||||||||||
|
I found another instance of this: http://buildbot.askmonty.org/buildbot/builders/kvm-dgcov-jaunty-i386/builds/4408 | |||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2014-11-26 ] | |||||||||||||||||||||||||||||||
|
Another way this bug can occur is if DEBUG_SYNC is used inside ENTER_COND / EXIT_COND. Because DEBUG_SYNC changes current_mutex, which can race to give the problem seen here. | |||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2014-11-26 ] | |||||||||||||||||||||||||||||||
|
I think I found it. I managed to reproduce the bug reliably by inserting these sleeps in the code:
I think the problem is in debug_sync_execute():
Note, that if old_mutex is NULL, then debug_sync_execute() will leave a Seems clear enough now. | |||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2014-11-26 ] | |||||||||||||||||||||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2014-November/007071.html |