summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2008-03-07 22:42:48 (GMT)
committerandreas_kupries <akupries@shaw.ca>2008-03-07 22:42:48 (GMT)
commit56e9c5c947e0b823c849db2ba32b86e382615f55 (patch)
treefcfc35f56a9cec72b96133d5e90043cd507c4f85
parent4836d8cd07f44d31f6c4edfe2726dd28d3309b5a (diff)
downloadtcl-56e9c5c947e0b823c849db2ba32b86e382615f55.zip
tcl-56e9c5c947e0b823c849db2ba32b86e382615f55.tar.gz
tcl-56e9c5c947e0b823c849db2ba32b86e382615f55.tar.bz2
* generic/tclResult.c (ReleaseKeys): Workaround for [Bug
1904907]. Reset the return option keys to NULL to allow full re-initialization by GetKeys(). This introduces a memory leak for the key objects, but gets us around a crash in the finalization of reflected channels when handling returns, either at compile- or runtime. In both cases we access the keys after they have been released by their thread exit handler. A proper fix is entangled with the untangling of the finalization ordering and attendant issues. For now we choose the lesser evil.
-rw-r--r--ChangeLog13
-rw-r--r--generic/tclResult.c3
-rw-r--r--unix/dltest/Makefile.in4
3 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index cce551f..732fa60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-03-07 Andreas Kupries <andreask@activestate.com>
+
+ * generic/tclResult.c (ReleaseKeys): Workaround for [Bug
+ 1904907]. Reset the return option keys to NULL to allow full
+ re-initialization by GetKeys(). This introduces a memory leak
+ for the key objects, but gets us around a crash in the
+ finalization of reflected channels when handling returns, either
+ at compile- or runtime. In both cases we access the keys after
+ they have been released by their thread exit handler. A proper
+ fix is entangled with the untangling of the finalization
+ ordering and attendant issues. For now we choose the lesser
+ evil.
+
2008-03-07 Don Porter <dgp@users.sourceforge.net>
* generic/tclExecute.c (Tcl_ExprObj): Revised expression bytecode
diff --git a/generic/tclResult.c b/generic/tclResult.c
index f9ef5b6..054ba9d 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclResult.c,v 1.46 2008/02/29 21:02:20 dgp Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.47 2008/03/07 22:42:49 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -1161,6 +1161,7 @@ ReleaseKeys(
for (i = KEY_CODE; i < KEY_LAST; i++) {
Tcl_DecrRefCount(keys[i]);
+ keys[i] = NULL;
}
}
diff --git a/unix/dltest/Makefile.in b/unix/dltest/Makefile.in
index 53a45a9..5ac2df0 100644
--- a/unix/dltest/Makefile.in
+++ b/unix/dltest/Makefile.in
@@ -1,7 +1,7 @@
# This Makefile is used to create several test cases for Tcl's load
# command. It also illustrates how to take advantage of configuration
# exported by Tcl to set up Makefiles for shared libraries.
-# RCS: @(#) $Id: Makefile.in,v 1.20 2006/12/17 03:47:09 das Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.21 2008/03/07 22:42:53 andreas_kupries Exp $
CC = @CC@
LIBS = @TCL_BUILD_STUB_LIB_SPEC@ @TCL_LIBS@
@@ -99,4 +99,4 @@ clean:
fi
distclean: clean
- rm -f Makefile
+ rm -f Makefile \ No newline at end of file