diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2019-09-09 13:48:36 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2019-09-09 13:52:30 +0200 |
commit | 2336e0b3944b73379f9d773b4e1b37cbc723bce4 (patch) | |
tree | f062203eb7a58288763d5dd98b17d2b14faee69e | |
parent | a895c68c58441e84d8ecbe336a7bbd19fc995e37 (diff) | |
download | mariadb-git-2336e0b3944b73379f9d773b4e1b37cbc723bce4.tar.gz |
MDEV-20206 : Crash inside timer_callback()[threadpool_win.cc:419]
The most likely cause of the crash is that a timer fired, after it was closed.
MSDN documents such a possibility, in the documentation for
CloseThreadpoolTimer() function, and recommends disabling the timer before
calling WaitForThreadpoolTimerCallbacks()/CloseThreadpoolTimer().
The fix follows this recommendation.
Note, that 5.5-10.1 disabled the timer before close, but this code
was lost in threadpool refactoring in 10.2
-rw-r--r-- | sql/threadpool_win.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc index 10d6e96b22f..1e2084b9c07 100644 --- a/sql/threadpool_win.cc +++ b/sql/threadpool_win.cc @@ -308,6 +308,7 @@ TP_connection_win::~TP_connection_win() if (timer) { + SetThreadpoolTimer(timer, 0, 0, 0); WaitForThreadpoolTimerCallbacks(timer, TRUE); CloseThreadpoolTimer(timer); } |