MDEV-17413 Crash in my_malloc_size_cb_func() during shutdown with
forceful connection close. Fix is to ensure that when close_connection() is called from shutdown thread, current_thd is set. This that allocation callback for THD specific memory won't assert(in debug version), or crash (in 10.1 and later) close_connection() allocates THD specific memory e.g when it writes the final error packet, and compression is ON for the connection.
This commit is contained in:
parent
bd21904357
commit
00ddc8bc7c
@ -1699,7 +1699,14 @@ static void close_connections(void)
|
||||
tmp->thread_id,
|
||||
(tmp->main_security_ctx.user ?
|
||||
tmp->main_security_ctx.user : ""));
|
||||
/*
|
||||
close_connection() might need a valid current_thd
|
||||
for memory allocation tracking.
|
||||
*/
|
||||
THD* save_thd= current_thd;
|
||||
set_current_thd(tmp);
|
||||
close_connection(tmp,ER_SERVER_SHUTDOWN);
|
||||
set_current_thd(save_thd);
|
||||
}
|
||||
#endif
|
||||
DBUG_PRINT("quit",("Unlocking LOCK_thread_count"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user