mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
Bug#18235: assertion/crash when windows mysqld is ended with ctrl-c
Two threads both try a shutdown sequence which creates a race to the de-init/free of certain resources. This exists in similar form in the client as 17926: "mysql.exe crashes when ctrl-c is pressed in windows." sql/mysqld.cc: We have three potential ways of hitting the iceberg: - unireg_end() has basic de-init - unireg_abort() has extended de-init - main() has a de-init sequence similar to unireg_abort() In the Windows version of the server, Control-C is handled in a different thread from the one main() is in. The main loop is told to end, then unireg_abort() is called. Its de-init and that of main() will then race each other for mutex- and cond-var-destroys, free(), and finally exit(). This patch introduces a special case for Windows that will eliminate the race by ending the signal-handler via unireg_end() instead if SIGINT is signalled. This seems the least intrusive fix that still fixes user-visible behaviour.
This commit is contained in:
parent
e066cb33b2
commit
b5000fbaa7
1 changed files with 5 additions and 1 deletions
|
@ -991,7 +991,11 @@ static void __cdecl kill_server(int sig_ptr)
|
|||
my_thread_init(); // If this is a new thread
|
||||
#endif
|
||||
close_connections();
|
||||
if (sig != MYSQL_KILL_SIGNAL && sig != 0)
|
||||
if (sig != MYSQL_KILL_SIGNAL &&
|
||||
#ifdef __WIN__
|
||||
sig != SIGINT && /* Bug#18235 */
|
||||
#endif
|
||||
sig != 0)
|
||||
unireg_abort(1); /* purecov: inspected */
|
||||
else
|
||||
unireg_end();
|
||||
|
|
Loading…
Reference in a new issue