summaryrefslogtreecommitdiffstats
path: root/runtime/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-09-18 12:45:44 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-09-18 12:45:44 +0200
commit9d8bb5629b6131be7c260ab3f9169ea1055c07f6 (patch)
treefa017f714eb4c75f94b9902f66c59f24d4bb4bf6 /runtime/debug.c
parent7b63cd6feda5087c43652bdcf8e694b544295d5b (diff)
parent4c96ebdcfe075e80810b01257cf21ea1c9b3ec0e (diff)
downloadrsyslog-9d8bb5629b6131be7c260ab3f9169ea1055c07f6.tar.gz
rsyslog-9d8bb5629b6131be7c260ab3f9169ea1055c07f6.tar.xz
rsyslog-9d8bb5629b6131be7c260ab3f9169ea1055c07f6.zip
Merge branch 'helgrind' into perf
Conflicts: ChangeLog
Diffstat (limited to 'runtime/debug.c')
-rw-r--r--runtime/debug.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/debug.c b/runtime/debug.c
index 958fb596..8d7b0084 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -481,7 +481,23 @@ static inline void dbgMutexUnlockLog(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncDB
pthread_mutex_lock(&mutMutLog);
pLog = dbgMutLogFindSpecific(pmut, MUTOP_LOCK, NULL);
+#if 0 /* toggle for testing */
assert(pLog != NULL);
+#else
+/* the change below seems not to work - the problem seems to be a real race... I keep this code in just in case
+ * I need to re-use it. It should be removed once we are finished analyzing this problem. -- rgerhards, 2008-09-17
+ */
+if(pLog == NULL) {
+ /* this may happen due to some races. We do not try to avoid
+ * this, as it would complicate the "real" code. This is not justified
+ * just to keep the debug info system up. -- rgerhards, 2008-09-17
+ */
+ pthread_mutex_unlock(&mutMutLog);
+ dbgprintf("%s:%d:%s: mutex %p UNlocked [but we did not yet know this mutex!]\n",
+ pFuncDB->file, unlockLn, pFuncDB->func, (void*)pmut);
+ return; /* if we don't know it yet, we can not clean up... */
+}
+#endif
/* we found the last lock entry. We now need to see from which FuncDB we need to
* remove it. This is recorded inside the mutex log entry.