diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-26 10:09:04 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-26 10:09:04 +0100 |
commit | 6be07a8f8a3b9b7baf77e42639473e9b1a990e29 (patch) | |
tree | dade763f274a4a035cd6fed684c7eeb17599e37e | |
parent | eb5cb72ec4cb4ac5d7f13855ac4dac9b6927078c (diff) | |
download | rsyslog-6be07a8f8a3b9b7baf77e42639473e9b1a990e29.tar.gz rsyslog-6be07a8f8a3b9b7baf77e42639473e9b1a990e29.tar.xz rsyslog-6be07a8f8a3b9b7baf77e42639473e9b1a990e29.zip |
bugfix: potential abort if inputname property was not set
primarily a problem of imdiag. Also added some fix for a potential
situation during cancel processing. That one is not considered vital
and may later be removed again.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | runtime/msg.c | 2 | ||||
-rw-r--r-- | runtime/queue.c | 6 |
3 files changed, 8 insertions, 2 deletions
@@ -5,6 +5,8 @@ Version 5.3.3 [DEVEL] (rgerhards), 2009-10-?? value for malloced memory (optional, only if requested by configure option). This helps to track down some otherwise undetected issues within the testbench. +- bugfix: potential abort if inputname property was not set + primarily a problem of imdiag - bugfix: message processing states were not set correctly in all cases however, this had no negative effect, as the message processing state was not evaluated when a batch was deleted, and that was the only case diff --git a/runtime/msg.c b/runtime/msg.c index 6d5b9cee..623c5b4a 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -288,7 +288,7 @@ static inline void getInputName(msg_t *pM, uchar **ppsz, int *plen) { BEGINfunc - if(pM == NULL) { + if(pM == NULL || pM->pInputName == NULL) { *ppsz = UCHAR_CONSTANT(""); *plen = 0; } else { diff --git a/runtime/queue.c b/runtime/queue.c index 4bbcc2b8..67bc40c2 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -1612,18 +1612,21 @@ RateLimiter(qqueue_t *pThis) } -/* This dequeues the next batch. +/* This dequeues the next batch. Note that this function must not be + * cancelled, else it will leave back an inconsistent state. * rgerhards, 2009-05-20 */ static inline rsRetVal DequeueForConsumer(qqueue_t *pThis, wti_t *pWti) { + int iCancelStateSave; DEFiRet; ISOBJ_TYPE_assert(pThis, qqueue); ISOBJ_TYPE_assert(pWti, wti); dbgprintf("YYY: dequeue for consumer\n"); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); CHKiRet(DequeueConsumable(pThis, pWti)); if(pWti->batch.nElem == 0) @@ -1631,6 +1634,7 @@ dbgprintf("YYY: dequeue for consumer\n"); finalize_it: + pthread_setcancelstate(iCancelStateSave, NULL); RETiRet; } |