[MDEV-10010] Recursive call to mysql_rwlock_rdlock for LOCK_system_variables_hash Created: 2016-04-29 Updated: 2016-08-11 Resolved: 2016-07-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Locking |
| Affects Version/s: | 10.1 |
| Fix Version/s: | 5.5.51, 10.1.16, 10.0.27, 10.2.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 10.1.15 |
| Description |
|
Application verifier reports an error in plugins_var test (recursive read lock on reader writer lock) for LOCK_system_variables_hash. The lock is acquired in sql_show.cc , in fill_variables() function
however the same lock is acquired again deeper inside show_status array. appverifier points to this callstack
On Windows, recursive shared lock acquire can cause a deadlock. Here is the explanation of the bug given by windbg command '!analyze -v'
|
| Comments |
| Comment by Sergey Vojtovich [ 2016-04-29 ] |
|
I agree it should be fixed, but it's not that trivial. |
| Comment by Vladislav Vaintroub [ 2016-04-29 ] |
|
Thanks for the above link. It points to single unix spec But |
| Comment by Vladislav Vaintroub [ 2016-04-29 ] |
|
Thinking a little more, it may not be as easy to add recursion to SRW locks.... The last measure of going back to generic implementation with in thr_rwlock with mutex and condition variable, but maybe we can avoid it for this single case of read lock recursion. |
| Comment by Vladislav Vaintroub [ 2016-05-20 ] |
|
On why windows reader-writer lock can't be used recursively see also https://blogs.msdn.microsoft.com/oldnewthing/20160506-00/?p=93416 |
| Comment by Sergey Vojtovich [ 2016-06-27 ] |
|
serg, please review fix for this bug. |
| Comment by Vladislav Vaintroub [ 2016-08-03 ] |
|
elenst , I backported the fix to 5.5 |