diff options
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | plugins/imuxsock/imuxsock.c | 9 | ||||
-rw-r--r-- | runtime/stream.c | 11 | ||||
-rw-r--r-- | runtime/strmsrv.c | 6 | ||||
-rw-r--r-- | tcpsrv.c | 3 | ||||
-rw-r--r-- | tools/syslogd.c | 2 |
6 files changed, 49 insertions, 6 deletions
@@ -24,8 +24,19 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-03-?? closes: http://bugzilla.adiscon.com/show_bug.cgi?id=236 --------------------------------------------------------------------------- Version 5.8.1 [V5-stable] (rgerhards), 2011-04-?? +- bugfix: rate-limiting inside imuxsock did not work 100% correct + reason was that a global config variable was invalidly accessed where a + listener variable should have been used. + Also performance-improved the case when rate limiting is turned off (this + is a very unintrusive change, thus done directly to the stable version). - bugfix: $myhostname not available in RainerScript (and no error message) closes: http://bugzilla.adiscon.com/show_bug.cgi?id=233 +- bugfix: memory and file descriptor leak in stream processing + Leaks could occur under some circumstances if the file stream handler + errored out during the open call. Among others, this could cause very + big memory leaks if there were a problem with unreadable disk queue + files. In regard to the memory leak, this + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=256 - bugfix: doc for impstats had wrong config statements also, config statements were named a bit inconsistent, resolved that problem by introducing an alias and only documenting the consistent @@ -34,6 +45,9 @@ Version 5.8.1 [V5-stable] (rgerhards), 2011-04-?? - bugfix: IPv6-address could not be specified in omrelp this was due to improper parsing of ":" closes: http://bugzilla.adiscon.com/show_bug.cgi?id=250 +- bugfix: TCP connection invalidly aborted when messages needed to be + discarded (due to QUEUE_FULL or similar problem) +- bugfix(minor): improper template function call in syslogd.c --------------------------------------------------------------------------- Version 5.8.0 [V5-stable] (rgerhards), 2011-04-12 @@ -823,6 +837,12 @@ Version 4.6.6 [v4-stable] (rgerhards), 2010-11-?? - bugfix: IPv6-address could not be specified in omrelp this was due to improper parsing of ":" closes: http://bugzilla.adiscon.com/show_bug.cgi?id=250 +- bugfix: memory and file descriptor leak in stream processing + Leaks could occur under some circumstances if the file stream handler + errored out during the open call. Among others, this could cause very + big memory leaks if there were a problem with unreadable disk queue + files. In regard to the memory leak, this + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=256 - bugfix: imfile potentially duplicates lines This can happen when 0 bytes are read from the input file, and some writer appends data to the file BEFORE we check if a rollover happens. @@ -848,6 +868,10 @@ Version 4.6.6 [v4-stable] (rgerhards), 2010-11-?? bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=221 - bugfix: omlibdbi did not use password from rsyslog.con closes: http://bugzilla.adiscon.com/show_bug.cgi?id=203 +- bugfix: TCP connection invalidly aborted when messages needed to be + discarded (due to QUEUE_FULL or similar problem) +- bugfix: a slightly more informative error message when a TCP + connections is aborted - some improvements thanks to clang's static code analyzer o overall cleanup (mostly unnecessary writes and otherwise unused stuff) o bugfix: fixed a very remote problem in msg.c which could occur when diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 86393ba6..af034b9f 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -432,7 +432,8 @@ finalize_it: /* find ratelimiter to use for this message. Currently, we use the * pid, but may change to cgroup later (probably via a config switch). - * Returns NULL if not found. + * Returns NULL if not found or rate-limiting not activated for this + * listener (the latter being a performance enhancement). */ static inline rsRetVal findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl) @@ -444,6 +445,10 @@ findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl) if(cred == NULL) FINALIZE; + if(pLstn->ratelimitInterval == 0) { + *prl = NULL; + FINALIZE; + } rl = hashtable_search(pLstn->ht, &cred->pid); if(rl == NULL) { @@ -454,7 +459,7 @@ findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl) CHKmalloc(rl = malloc(sizeof(rs_ratelimit_state_t))); CHKmalloc(keybuf = malloc(sizeof(pid_t))); *keybuf = cred->pid; - initRatelimitState(rl, ratelimitInterval, pLstn->ratelimitBurst); + initRatelimitState(rl, pLstn->ratelimitInterval, pLstn->ratelimitBurst); r = hashtable_insert(pLstn->ht, keybuf, rl); if(r == 0) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); diff --git a/runtime/stream.c b/runtime/stream.c index 24dbcc09..ae716815 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -259,6 +259,7 @@ static rsRetVal strmOpenFile(strm_t *pThis) if(pThis->fd != -1) ABORT_FINALIZE(RS_RET_OK); + pThis->pszCurrFName = NULL; /* used to prevent mem leak in case of error */ if(pThis->pszFName == NULL) ABORT_FINALIZE(RS_RET_FILE_PREFIX_MISSING); @@ -290,6 +291,16 @@ static rsRetVal strmOpenFile(strm_t *pThis) (pThis->tOperationsMode == STREAMMODE_READ) ? "READ" : "WRITE", pThis->fd); finalize_it: + if(iRet != RS_RET_OK) { + if(pThis->pszCurrFName != NULL) { + free(pThis->pszCurrFName); + pThis->pszCurrFName = NULL; /* just to prevent mis-adressing down the road... */ + } + if(pThis->fd != -1) { + close(pThis->fd); + pThis->fd = -1; + } + } RETiRet; } diff --git a/runtime/strmsrv.c b/runtime/strmsrv.c index e66ad717..f448cd4f 100644 --- a/runtime/strmsrv.c +++ b/runtime/strmsrv.c @@ -521,6 +521,7 @@ Run(strmsrv_t *pThis) strms_sess_t *pNewSess; nssel_t *pSel; ssize_t iRcvd; + rsRetVal localRet; ISOBJ_TYPE_assert(pThis, strmsrv); @@ -580,11 +581,12 @@ Run(strmsrv_t *pThis) break; case RS_RET_OK: /* valid data received, process it! */ - if(strms_sess.DataRcvd(pThis->pSessions[iSTRMSess], buf, iRcvd) != RS_RET_OK) { + localRet = strms_sess.DataRcvd(pThis->pSessions[iSTRMSess], buf, iRcvd); + if(localRet != RS_RET_OK) { /* in this case, something went awfully wrong. * We are instructed to terminate the session. */ - errmsg.LogError(0, NO_ERRCODE, "Tearing down STRM Session %d - see " + errmsg.LogError(0, localRet, "Tearing down STRM Session %d - see " "previous messages for reason(s)\n", iSTRMSess); pThis->pOnErrClose(pThis->pSessions[iSTRMSess]); strms_sess.Destruct(&pThis->pSessions[iSTRMSess]); @@ -518,7 +518,8 @@ doReceive(tcpsrv_t *pThis, tcps_sess_t **ppSess, nspoll_t *pPoll) break; case RS_RET_OK: /* valid data received, process it! */ - if((localRet = tcps_sess.DataRcvd(*ppSess, buf, iRcvd)) != RS_RET_OK) { + localRet = tcps_sess.DataRcvd(*ppSess, buf, iRcvd); + if(localRet != RS_RET_OK && localRet != RS_RET_QUEUE_FULL) { /* in this case, something went awfully wrong. * We are instructed to terminate the session. */ diff --git a/tools/syslogd.c b/tools/syslogd.c index c9734d14..487ab364 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -2172,7 +2172,7 @@ static rsRetVal mainThread() pTmp = template_StdDBFmt; tplAddLine(" StdDBFmt", &pTmp); pTmp = template_StdPgSQLFmt; - tplLastStaticInit(tplAddLine(" StdPgSQLFmt", &pTmp)); + tplAddLine(" StdPgSQLFmt", &pTmp); pTmp = template_spoofadr; tplLastStaticInit(tplAddLine("RSYSLOG_omudpspoofDfltSourceTpl", &pTmp)); |