summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-30 18:54:49 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-30 18:54:49 +0200
commita0496e7bd4cba22d2559adb50cd286f75cc6a40e (patch)
tree29d49937e28a3dbac19ea6da84c11ac84a365d92
parent8515376ac9b8549a4b93d87455df626cca0199b7 (diff)
downloadrsyslog-a0496e7bd4cba22d2559adb50cd286f75cc6a40e.tar.gz
rsyslog-a0496e7bd4cba22d2559adb50cd286f75cc6a40e.tar.xz
rsyslog-a0496e7bd4cba22d2559adb50cd286f75cc6a40e.zip
internal bugfix: object pointer was only reset to NULL when an object was actually destructed.
This most likely had no effect to existing code, but it may also have caused trouble in remote cases. Similarly, the fix may also cause trouble... Due to this trouble scenario, the fix deserves its own commit.
-rw-r--r--ChangeLog6
-rw-r--r--runtime/obj-types.h11
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b9352957..294616df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------
+Version 4.3.3 [beta] (rgerhards), 2009-0?-??
+- internal bugfix: object pointer was only reset to NULL when an object
+ was actually destructed. This most likely had no effect to existing code,
+ but it may also have caused trouble in remote cases. Similarly, the fix
+ may also cause trouble...
+---------------------------------------------------------------------------
Version 4.3.2 [beta] (rgerhards), 2009-06-24
- removed long-obsoleted property UxTradMsg
- added a generic network stream server (in addition to rather specific
diff --git a/runtime/obj-types.h b/runtime/obj-types.h
index 78829f94..ff1819a9 100644
--- a/runtime/obj-types.h
+++ b/runtime/obj-types.h
@@ -292,6 +292,15 @@ rsRetVal objName##ClassExit(void) \
ISOBJ_TYPE_assert(pThis, OBJ); \
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
+/* note: there was a long-time bug in the macro below that lead to *ppThis = NULL
+ * only when the object was actually destructed. I discovered this issue during
+ * introduction of the pRcvFrom property in msg_t, but it potentially had other
+ * effects, too. I am not sure if some experienced instability resulted from this
+ * bug OR if its fix will cause harm to so-far "correctly" running code. The later
+ * may very well be. Thus I will change it only for the current branch and also
+ * the beta, but not in all old builds. Let's see how things evolve.
+ * rgerhards, 2009-06-30
+ */
#define ENDobjDestruct(OBJ) \
goto finalize_it; /* prevent compiler warning ;) */ \
/* no more code here! */ \
@@ -299,8 +308,8 @@ rsRetVal objName##ClassExit(void) \
if(pThis != NULL) { \
obj.DestructObjSelf((obj_t*) pThis); \
free(pThis); \
- *ppThis = NULL; \
} \
+ *ppThis = NULL; \
pthread_setcancelstate(iCancelStateSave, NULL); \
RETiRet; \
}