Skip to content

Commit 2336e0b

Browse files
committed
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
1 parent a895c68 commit 2336e0b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sql/threadpool_win.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ TP_connection_win::~TP_connection_win()
308308

309309
if (timer)
310310
{
311+
SetThreadpoolTimer(timer, 0, 0, 0);
311312
WaitForThreadpoolTimerCallbacks(timer, TRUE);
312313
CloseThreadpoolTimer(timer);
313314
}

0 commit comments

Comments
 (0)