[MDEV-18225] mysqld crash on shutdown, in Statement_map destructor Created: 2019-01-14  Updated: 2019-01-15  Resolved: 2019-01-15

Status: Closed
Project: MariaDB Server
Component/s: Locking, Server
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3, 10.4
Fix Version/s: 10.4.2, 10.1.38, 10.2.22, 10.3.13

Type: Bug Priority: Major
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None


 Description   

As seen on buildbot http://buildbot.askmonty.org/buildbot/builders/winx64-debug/builds/11784/steps/test/logs/stdio

The reason for the crash is that THD destructor calls Statement_map destructor, which tries to access an already freed mutex LOCK_prepared_stmt_count.

All mutexes are freed when thread_count goes to 0, which happens when unlink_thd() is called for the last THD. Yet, THD destructor is called later, and thus can potentially access a freed mutex.


Generated at Thu Feb 08 08:42:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.