summaryrefslogtreecommitdiffstats
path: root/runtime/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-02-23 08:54:31 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-02-23 08:54:31 +0100
commite867cb41372e9b8e08b8eec0d663a1f3ccea5367 (patch)
tree87c2414eb0b5e7d0c7702fb498bd735ca6f2fd7b /runtime/msg.c
parent095a7ec73883ff14ff428653a5fa153892c1497a (diff)
downloadrsyslog-e867cb41372e9b8e08b8eec0d663a1f3ccea5367.tar.gz
rsyslog-e867cb41372e9b8e08b8eec0d663a1f3ccea5367.tar.xz
rsyslog-e867cb41372e9b8e08b8eec0d663a1f3ccea5367.zip
added debug support for trying to find well-hidden bug
Diffstat (limited to 'runtime/msg.c')
-rw-r--r--runtime/msg.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index e8be79db..fb4d5742 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -677,6 +677,7 @@ static inline rsRetVal msgBaseConstruct(msg_t **ppThis)
/* initialize members in ORDER they appear in structure (think "cache line"!) */
pM->flowCtlType = 0;
pM->bDoLock = 0;
+ pM->bAlreadyFreed = 0;
pM->iRefCount = 1;
pM->iSeverity = -1;
pM->iFacility = -1;
@@ -803,6 +804,15 @@ CODESTARTobjDestruct(msg)
if(currRefCount == 0)
{
/* DEV Debugging Only! dbgprintf("msgDestruct\t0x%lx, RefCount now 0, doing DESTROY\n", (unsigned long)pThis); */
+ /* The if below is included to try to nail down a well-hidden bug causing
+ * segfaults. I hope that do to the test code the problem is sooner detected and
+ * thus we get better data for debugging and resolving it. -- rgerhards, 2011-02-23.
+ * TODO: remove when no longer needed.
+ */
+ if(pThis->bAlreadyFreed)
+ abort();
+ pThis->bAlreadyFreed = 1;
+ /* end debug code */
if(pThis->pszRawMsg != pThis->szRawMsg)
free(pThis->pszRawMsg);
freeTAG(pThis);