summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@oracle.com>2012-03-28 17:54:30 +0200
committerMarc Alff <marc.alff@oracle.com>2012-03-28 17:54:30 +0200
commit7553f9eefdcdf67d31caa2a64b826dd476b4c35e (patch)
tree7618c8a84b83e005ba904405ff83842efaf9db67 /mysys
parentfe12e0b2cc2230f6509783d34afeb5069aaf0034 (diff)
downloadmariadb-git-7553f9eefdcdf67d31caa2a64b826dd476b4c35e.tar.gz
Bug#13898343 THREAD LOOPS ENDLESSLY IN LF_PINBOX_PUT_PINS WHILE HOLDING
LOCK_THREAD_COUNT When using the performance schema file io instrumentation in MySQL 5.5, a thread would loop forever inside lf_pinbox_put_pins, when disconnecting. It would also hold LOCK_thread_count while doing so, effectively killing the server. The root cause of the loop in lf_pinbox_put_pins() is a leak of LF_PINS, when used with the filename_hash LF_HASH table in the performance schema. This fix contains the following changes: 1) Added the missing call to lf_hash_search_unpin(), to prevent the leak. 2) In mysys/lf_alloc-pin.c, there was some extra debugging code (MY_LF_EXTRA_DEBUG) written to detect precisely this kind of issues, but it was never used. Replaced MY_LF_EXTRA_DEBUG with DBUG_OFF, so that leaks similar to this one can be always detected in regular debug builds. 3) Backported the fix for the following bug, from 5.6 to 5.5: Bug#13417446 - 63339: INCORRECT FILE PATH IN PEFORMANCE_SCHEMA ON WINDOWS
Diffstat (limited to 'mysys')
-rw-r--r--mysys/lf_alloc-pin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index 22887d17c07..7af87bca111 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -211,13 +211,16 @@ void _lf_pinbox_put_pins(LF_PINS *pins)
LF_PINBOX *pinbox= pins->pinbox;
uint32 top_ver, nr;
nr= pins->link;
-#ifdef MY_LF_EXTRA_DEBUG
+
+#ifndef DBUG_OFF
{
+ /* This thread should not hold any pin. */
int i;
for (i= 0; i < LF_PINBOX_PINS; i++)
DBUG_ASSERT(pins->pin[i] == 0);
}
-#endif
+#endif /* DBUG_OFF */
+
/*
XXX this will deadlock if other threads will wait for
the caller to do something after _lf_pinbox_put_pins(),