summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-12-15 20:59:21 -0200
committerDavi Arnaut <davi.arnaut@oracle.com>2010-12-15 20:59:21 -0200
commit487f9bb219318ec804659f0fafa5d0e94d587786 (patch)
tree40ac241a8b0dc4aaa69489f0e28b7b759da0511f /sql/sql_parse.cc
parenteb5a21dd909b2001235c7b8cf05075ebc170f6ea (diff)
downloadmariadb-git-487f9bb219318ec804659f0fafa5d0e94d587786.tar.gz
Bug#58136: Crash in vio_close at concurrent disconnect and KILL
The problem is a race between a session closing its vio (i.e. after a COM_QUIT) at the same time it is being killed by another thread. This could trigger a assertion in vio_close() as the two threads could end up closing the same vio, at the same time. This could happen due to the implementation of SIGNAL_WITH_VIO_CLOSE, which closes the vio of the thread being killed. The solution is to serialize the close of the Vio under LOCK_thd_data, which protects THD data. No regression test is added as this is essentially a debug issue and the test case would be quite convoluted as we would need to synchronize a session that is being killed -- which is a bit difficult since debug sync points code does not synchronize killed sessions.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index dff6510817f..c4782f37417 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -600,7 +600,7 @@ void do_handle_bootstrap(THD *thd)
if (my_thread_init() || thd->store_globals())
{
#ifndef EMBEDDED_LIBRARY
- close_connection(thd, ER_OUT_OF_RESOURCES, 1);
+ close_connection(thd, ER_OUT_OF_RESOURCES);
#endif
thd->fatal_error();
goto end;