diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-02-28 16:23:18 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-02-28 16:23:18 +0100 |
commit | c0f92325c634fd3d0482f5d8bdc6650ab725cce1 (patch) | |
tree | 87073391e08087a17d2088b14523cdb63e57b524 /runtime/msg.c | |
parent | bf088c5c2ed06db1c765a96df3762a00ae44db9c (diff) | |
parent | 74a71e798efd58e20cc150b04de2613bf518eed4 (diff) | |
download | rsyslog-c0f92325c634fd3d0482f5d8bdc6650ab725cce1.tar.gz rsyslog-c0f92325c634fd3d0482f5d8bdc6650ab725cce1.tar.xz rsyslog-c0f92325c634fd3d0482f5d8bdc6650ab725cce1.zip |
Merge branch 'master' into master-tcpsrv-mt
Diffstat (limited to 'runtime/msg.c')
-rw-r--r-- | runtime/msg.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index ad045dec..70b20749 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -686,6 +686,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; @@ -813,6 +814,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); |