summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-07-14 11:19:56 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-07-14 11:19:56 +0200
commit93fed4bd309f658a23cff3b3133ab124ee226557 (patch)
tree14efb2f526ad7e588aad6d02ed7d73234c66ca96
parent1790a23aea2d98dd855d55a990aae18c5eb0e8b3 (diff)
parent816fda97750454bba0845a83d1a2b1ddcabe85e4 (diff)
downloadrsyslog-93fed4bd309f658a23cff3b3133ab124ee226557.tar.gz
rsyslog-93fed4bd309f658a23cff3b3133ab124ee226557.tar.xz
rsyslog-93fed4bd309f658a23cff3b3133ab124ee226557.zip
Merge branch 'beta' - important mutex bugfix
Conflicts: ChangeLog configure.ac doc/Makefile.am doc/manual.html
-rw-r--r--ChangeLog15
-rw-r--r--doc/Makefile.am6
-rw-r--r--runtime/msg.c31
3 files changed, 50 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5757273f..1c41bc7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
---------------------------------------------------------------------------
Version 3.19.10 (rgerhards), 2008-07-??
- bugfix: bad memory leak in disk-based queue modes
+- important queue bugfix from 3.18.1 imported (see below)
---------------------------------------------------------------------------
Version 3.19.9 (rgerhards), 2008-07-07
- added tutorial for creating a TLS-secured syslog infrastructure
@@ -135,6 +136,20 @@ Version 3.19.0 (rgerhards), 2008-05-06
- -c option no longer must be the first option - thanks to varmjofekoj
for the patch
Version 3.18.0 (rgerhards), 2008-07-??
+=======
+Version 3.18.1 (rgerhards), 2008-07-??
+- bugfix: potential segfault in creating message mutex in non-direct queue
+ mode. rsyslogd segfaults on freeeBSD 7.0 (an potentially other platforms)
+ if an action queue is running in any other mode than non-direct. The
+ same problem can potentially be triggered by some main message queue
+ settings. In any case, it will manifest during rsylog's startup. It is
+ unlikely to happen after a successful startup (the only window of
+ exposure may be a relatively seldom executed action running in queued
+ mode). This has been corrected. Thank to HKS for point out the problem.
+---------------------------------------------------------------------------
+Version 3.18.0 (rgerhards), 2008-07-11
+- begun a new v3-stable based on former 3.17.4 beta plus patches to
+ previous v3-stable
- bugfix in RainerScript: syntax error was not always detected
---------------------------------------------------------------------------
Version 3.17.5 (rgerhards), 2008-06-27
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f7c81c61..de3675de 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -90,6 +90,12 @@ html_files = \
ns_gtls.html \
ns_ptcp.html \
src/tls_cert.dia \
+ gssapi.html \
+ licensing.html \
+ ommail.html \
+ omrelp.html \
+ status.html \
+ troubleshoot.html \
src/classes.dia
EXTRA_DIST = $(html_files)
diff --git a/runtime/msg.c b/runtime/msg.c
index cf59f762..78ba19bf 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -158,14 +158,40 @@ static void MsgLockingDummy(msg_t __attribute__((unused)) *pMsg)
* where a message may be accessed by multiple threads. This implementation here
* is the version for multiple concurrent acces. It initializes the locking
* structures.
+ * TODO: change to an iRet interface! -- rgerhards, 2008-07-14
*/
static void MsgPrepareEnqueueLockingCase(msg_t *pThis)
{
+ int iErr;
+ BEGINfunc
assert(pThis != NULL);
- pthread_mutexattr_settype(&pThis->mutAttr, PTHREAD_MUTEX_RECURSIVE);
+ iErr = pthread_mutexattr_init(&pThis->mutAttr);
+ if(iErr != 0) {
+ dbgprintf("error initializing mutex attribute in %s:%d, trying to continue\n",
+ __FILE__, __LINE__);
+ }
+ iErr = pthread_mutexattr_settype(&pThis->mutAttr, PTHREAD_MUTEX_RECURSIVE);
+ if(iErr != 0) {
+ dbgprintf("ERROR setting mutex attribute to recursive in %s:%d, trying to continue "
+ "but we will probably either abort or hang soon\n",
+ __FILE__, __LINE__);
+ /* TODO: it makes very little sense to continue here,
+ * but it requires an iRet interface to gracefully shut
+ * down. We should do that over time. -- rgerhards, 2008-07-14
+ */
+ }
pthread_mutex_init(&pThis->mut, &pThis->mutAttr);
+
+ /* we do no longer need the attribute. According to the
+ * POSIX spec, we can destroy it without affecting the
+ * initialized mutex (that used the attribute).
+ * rgerhards, 2008-07-14
+ */
+ pthread_mutexattr_destroy(&pThis->mutAttr);
+ ENDfunc
}
+
/* ... and now the locking and unlocking implementations: */
static void MsgLockLockingCase(msg_t *pThis)
{
@@ -200,11 +226,12 @@ static void MsgDeleteMutexLockingCase(msg_t *pThis)
*/
rsRetVal MsgEnableThreadSafety(void)
{
+ DEFiRet;
funcLock = MsgLockLockingCase;
funcUnlock = MsgUnlockLockingCase;
funcMsgPrepareEnqueue = MsgPrepareEnqueueLockingCase;
funcDeleteMutex = MsgDeleteMutexLockingCase;
- return RS_RET_OK;
+ RETiRet;
}
/* end locking functions */