From 55659b96a38d926445c9ae4123df4b1d29e18c32 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Mon, 4 Jun 2012 12:01:24 +0200
Subject: add small delay (50ms) after sending shutdown message
There seem to be cases where the shutdown message is otherwise not
processed, not even on an idle system. Thanks to Marcin for
bringing this problem up.
---
ChangeLog | 4 ++++
tools/syslogd.c | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 25a67cfa..fd2b076a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,10 @@ Version 5.8.12 [V5-stable] 2012-05-??
please let us know.
Thanks to Tomas Heinrich for the patch.
- bugfix/tcpflood: sending small test files did not work correctly
+- add small delay (50ms) after sending shutdown message
+ There seem to be cases where the shutdown message is otherwise not
+ processed, not even on an idle system. Thanks to Marcin for
+ bringing this problem up.
---------------------------------------------------------------------------
Version 5.8.11 [V5-stable] 2012-05-03
- bugfix: ommysql did not properly init/exit the mysql runtime library
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 7872cb5f..0988d462 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1072,6 +1072,11 @@ die(int sig)
errno = 0;
logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)buf, 0);
}
+ /* we sleep for 50ms to give the queue a chance to pick up the exit message;
+ * otherwise we have seen cases where the message did not make it to log
+ * files, even on idle systems.
+ */
+ srSleep(0, 50);
/* drain queue (if configured so) and stop main queue worker thread pool */
DBGPRINTF("Terminating main queue...\n");
--
cgit v1.2.3
From d6874305fff15ce2d9862ef000d81fd2ea56ae23 Mon Sep 17 00:00:00 2001
From: Alec Warner
Date: Thu, 16 Feb 2012 18:25:38 -0800
Subject: call getgrnam_r repeatedly to get all group members.
---
runtime/cfsysline.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c
index 4997e0fb..a33810ed 100644
--- a/runtime/cfsysline.c
+++ b/runtime/cfsysline.c
@@ -338,11 +338,12 @@ static int doParseOnOffOption(uchar **pp)
*/
static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *pVal)
{
- struct group *pgBuf;
+ struct group *pgBuf = NULL;
struct group gBuf;
DEFiRet;
uchar szName[256];
- char stringBuf[2048]; /* I hope this is large enough... */
+ long bufSize = 2048;
+ char * stringBuf = malloc(bufSize);
assert(pp != NULL);
assert(*pp != NULL);
@@ -352,7 +353,15 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p
ABORT_FINALIZE(RS_RET_NOT_FOUND);
}
- getgrnam_r((char*)szName, &gBuf, stringBuf, sizeof(stringBuf), &pgBuf);
+ while(pgBuf == NULL) {
+ errno = 0;
+ getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf);
+ if((pgBuf == NULL) && (errno == ERANGE)) {
+ /* Increase bufsize and try again.*/
+ bufSize *= 2;
+ stringBuf = realloc(stringBuf, bufSize);
+ }
+ }
if(pgBuf == NULL) {
errmsg.LogError(0, RS_RET_NOT_FOUND, "ID for group '%s' could not be found or error", (char*)szName);
--
cgit v1.2.3
From e593f6a22fbebe7a06dd4b08b378ab5d12e7d8ad Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Wed, 6 Jun 2012 10:22:39 +0200
Subject: fixing memleak in recent group resolve patch
also added some error checking
---
ChangeLog | 3 +++
runtime/cfsysline.c | 9 ++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fd2b076a..073e6266 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
---------------------------------------------------------------------------
Version 5.8.12 [V5-stable] 2012-05-??
+- support for resolving huge groups
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=310
+ Thanks to Alec Warner for the patch
- bugfix: delayble source could block action queue, even if there was
a disk queue associated with it. The root cause of this problem was
that it makes no sense to delay messages once they arrive in the
diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c
index a33810ed..08ca65ca 100644
--- a/runtime/cfsysline.c
+++ b/runtime/cfsysline.c
@@ -342,8 +342,8 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p
struct group gBuf;
DEFiRet;
uchar szName[256];
- long bufSize = 2048;
- char * stringBuf = malloc(bufSize);
+ int bufSize = 2048;
+ char * stringBuf = NULL;
assert(pp != NULL);
assert(*pp != NULL);
@@ -353,13 +353,15 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p
ABORT_FINALIZE(RS_RET_NOT_FOUND);
}
+
+ CHKmalloc(stringBuf = malloc(bufSize));
while(pgBuf == NULL) {
errno = 0;
getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf);
if((pgBuf == NULL) && (errno == ERANGE)) {
/* Increase bufsize and try again.*/
bufSize *= 2;
- stringBuf = realloc(stringBuf, bufSize);
+ CHKmalloc(stringBuf = realloc(stringBuf, bufSize));
}
}
@@ -380,6 +382,7 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p
skipWhiteSpace(pp); /* skip over any whitespace */
finalize_it:
+ free(stringBuf);
RETiRet;
}
--
cgit v1.2.3
From 290f41f9470d06e4f207ca38c3175c578f6202ec Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Wed, 6 Jun 2012 12:56:53 +0200
Subject: bugfix: potential hang due to mutex deadlock
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=316
Thanks to Andreas Piesk for reporting&analyzing this bug as well as
providing patches and other help in resolving it.
---
ChangeLog | 12 ++++++++----
runtime/modules.c | 31 ++++---------------------------
runtime/obj.c | 4 ++--
runtime/obj.h | 4 ++++
4 files changed, 18 insertions(+), 33 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 073e6266..042ede0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
---------------------------------------------------------------------------
Version 5.8.12 [V5-stable] 2012-05-??
+- add small delay (50ms) after sending shutdown message
+ There seem to be cases where the shutdown message is otherwise not
+ processed, not even on an idle system. Thanks to Marcin for
+ bringing this problem up.
- support for resolving huge groups
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=310
Thanks to Alec Warner for the patch
@@ -28,10 +32,10 @@ Version 5.8.12 [V5-stable] 2012-05-??
please let us know.
Thanks to Tomas Heinrich for the patch.
- bugfix/tcpflood: sending small test files did not work correctly
-- add small delay (50ms) after sending shutdown message
- There seem to be cases where the shutdown message is otherwise not
- processed, not even on an idle system. Thanks to Marcin for
- bringing this problem up.
+- bugfix: potential hang due to mutex deadlock
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=316
+ Thanks to Andreas Piesk for reporting&analyzing this bug as well as
+ providing patches and other help in resolving it.
---------------------------------------------------------------------------
Version 5.8.11 [V5-stable] 2012-05-03
- bugfix: ommysql did not properly init/exit the mysql runtime library
diff --git a/runtime/modules.c b/runtime/modules.c
index 4541bddf..c2054e40 100644
--- a/runtime/modules.c
+++ b/runtime/modules.c
@@ -66,14 +66,6 @@ DEFobjCurrIf(errmsg)
DEFobjCurrIf(parser)
DEFobjCurrIf(strgen)
-/* we must ensure that only one thread at one time tries to load or unload
- * modules, otherwise we may see race conditions. This first came up with
- * imdiag/imtcp, which both use the same stream drivers. Below is the mutex
- * for that handling.
- * rgerhards, 2009-05-25
- */
-static pthread_mutex_t mutLoadUnload;
-
static modInfo_t *pLoadedModules = NULL; /* list of currently-loaded modules */
static modInfo_t *pLoadedModulesLast = NULL; /* tail-pointer */
@@ -667,7 +659,7 @@ modUnlinkAndDestroy(modInfo_t **ppThis)
pThis = *ppThis;
assert(pThis != NULL);
- pthread_mutex_lock(&mutLoadUnload);
+ pthread_mutex_lock(&mutObjGlobalOp);
/* first check if we are permitted to unload */
if(pThis->eType == eMOD_LIB) {
@@ -703,7 +695,7 @@ modUnlinkAndDestroy(modInfo_t **ppThis)
moduleDestruct(pThis);
finalize_it:
- pthread_mutex_unlock(&mutLoadUnload);
+ pthread_mutex_unlock(&mutObjGlobalOp);
RETiRet;
}
@@ -779,7 +771,7 @@ Load(uchar *pModName)
assert(pModName != NULL);
dbgprintf("Requested to load module '%s'\n", pModName);
- pthread_mutex_lock(&mutLoadUnload);
+ pthread_mutex_lock(&mutObjGlobalOp);
iModNameLen = strlen((char *) pModName);
if(iModNameLen > 3 && !strcmp((char *) pModName + iModNameLen - 3, ".so")) {
@@ -903,7 +895,7 @@ Load(uchar *pModName)
}
finalize_it:
- pthread_mutex_unlock(&mutLoadUnload);
+ pthread_mutex_unlock(&mutObjGlobalOp);
RETiRet;
}
@@ -1000,16 +992,6 @@ CODESTARTObjClassExit(module)
/* release objects we no longer need */
objRelease(errmsg, CORE_COMPONENT);
objRelease(parser, CORE_COMPONENT);
- /* We have a problem in our reference counting, which leads to this function
- * being called too early. This usually is no problem, but if we destroy
- * the mutex object, we get into trouble. So rather than finding the root cause,
- * we do not release the mutex right now and have a very, very slight leak.
- * We know that otherwise no bad effects happen, so this acceptable for the
- * time being. -- rgerhards, 2009-05-25
- *
- * TODO: add again: pthread_mutex_destroy(&mutLoadUnload);
- */
-
# ifdef DEBUG
modUsrPrintAll(); /* debug aid - TODO: integrate with debug.c, at least the settings! */
# endif
@@ -1051,7 +1033,6 @@ ENDobjQueryInterface(module)
*/
BEGINAbstractObjClassInit(module, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANGE class also in END MACRO! */
uchar *pModPath;
- pthread_mutexattr_t mutAttr;
/* use any module load path specified in the environment */
if((pModPath = (uchar*) getenv("RSYSLOG_MODDIR")) != NULL) {
@@ -1069,10 +1050,6 @@ BEGINAbstractObjClassInit(module, 1, OBJ_IS_CORE_MODULE) /* class, version - CHA
SetModDir(glblModPath);
}
- pthread_mutexattr_init(&mutAttr);
- pthread_mutexattr_settype(&mutAttr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&mutLoadUnload, &mutAttr);
-
/* request objects we use */
CHKiRet(objUse(errmsg, CORE_COMPONENT));
ENDObjClassInit(module)
diff --git a/runtime/obj.c b/runtime/obj.c
index 29ca8117..f9afecd8 100644
--- a/runtime/obj.c
+++ b/runtime/obj.c
@@ -97,7 +97,7 @@ DEFobjCurrIf(module)
DEFobjCurrIf(errmsg)
DEFobjCurrIf(strm)
static objInfo_t *arrObjInfo[OBJ_NUM_IDS]; /* array with object information pointers */
-static pthread_mutex_t mutObjGlobalOp; /* mutex to guard global operations of the object system */
+pthread_mutex_t mutObjGlobalOp; /* mutex to guard global operations of the object system */
/* cookies for serialized lines */
@@ -1319,7 +1319,7 @@ objClassInit(modInfo_t *pModInfo)
}
/* the mutex must be recursive, because objects may call into other
- * object identifieres recursively.
+ * object identifiers recursively.
*/
pthread_mutexattr_init(&mutAttr);
pthread_mutexattr_settype(&mutAttr, PTHREAD_MUTEX_RECURSIVE);
diff --git a/runtime/obj.h b/runtime/obj.h
index be97f20e..32f7ef09 100644
--- a/runtime/obj.h
+++ b/runtime/obj.h
@@ -122,4 +122,8 @@ rsRetVal objGetObjInterface(obj_if_t *pIf);
PROTOTYPEObjClassInit(obj);
PROTOTYPEObjClassExit(obj);
+
+/* the following definition is only for "friends" */
+extern pthread_mutex_t mutObjGlobalOp; /* mutex to guard global operations of the object system */
+
#endif /* #ifndef OBJ_H_INCLUDED */
--
cgit v1.2.3
From ff7b1382fa191a176175aba9b0ad308931b6301a Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Wed, 6 Jun 2012 13:04:40 +0200
Subject: bugfix: property PROCID was empty instead of proper nilvalue if not
present
If it is not present, it must have the nilvalue "-" as of RFC5424
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=332
Thanks to John N for reporting this issue.
---
ChangeLog | 4 ++++
runtime/msg.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 042ede0c..c299d97c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,10 @@ Version 5.8.12 [V5-stable] 2012-05-??
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=316
Thanks to Andreas Piesk for reporting&analyzing this bug as well as
providing patches and other help in resolving it.
+- bugfix: property PROCID empty instead of proper nilvalue if not present
+ If it is not present, it must have the nilvalue "-" as of RFC5424
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=332
+ Thanks to John N for reporting this issue.
---------------------------------------------------------------------------
Version 5.8.11 [V5-stable] 2012-05-03
- bugfix: ommysql did not properly init/exit the mysql runtime library
diff --git a/runtime/msg.c b/runtime/msg.c
index 7b94228c..820a28a8 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -1618,7 +1618,7 @@ char *getPROCID(msg_t *pM, sbool bLockMutex)
MsgLock(pM);
preparePROCID(pM, MUTEX_ALREADY_LOCKED);
if(pM->pCSPROCID == NULL)
- pszRet = UCHAR_CONSTANT("");
+ pszRet = UCHAR_CONSTANT("-");
else
pszRet = rsCStrGetSzStrNoNULL(pM->pCSPROCID);
if(bLockMutex == LOCK_MUTEX)
--
cgit v1.2.3
From 7f109cca88816752a9c9cbe255df9e3a5b5a8b5a Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Wed, 6 Jun 2012 14:47:24 +0200
Subject: preparing for 5.8.12
---
ChangeLog | 2 +-
configure.ac | 2 +-
doc/manual.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c299d97c..36b98564 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,5 @@
---------------------------------------------------------------------------
-Version 5.8.12 [V5-stable] 2012-05-??
+Version 5.8.12 [V5-stable] 2012-06-06
- add small delay (50ms) after sending shutdown message
There seem to be cases where the shutdown message is otherwise not
processed, not even on an idle system. Thanks to Marcin for
diff --git a/configure.ac b/configure.ac
index ff50984a..7f5815eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[5.8.11],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[5.8.12],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff --git a/doc/manual.html b/doc/manual.html
index 2ee85570..747b412a 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -19,7 +19,7 @@ rsyslog support available directly from the source!
Please visit the rsyslog sponsor's page
to honor the project sponsors or become one yourself! We are very grateful for any help towards the
project goals.
-This documentation is for version 5.8.11 (v5-stable branch) of rsyslog.
+
This documentation is for version 5.8.12 (v5-stable branch) of rsyslog.
Visit the rsyslog status page
to obtain current version information and project status.
If you like rsyslog, you might
--
cgit v1.2.3