diff options
author | Kevin B Kenny <kennykb@acm.org> | 2005-06-22 19:35:10 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2005-06-22 19:35:10 (GMT) |
commit | 37d7859f69fa858cde620a429a5616ced9059d3f (patch) | |
tree | ac752dcd448c2800fec0ea4fc60c787b9998a0c5 /generic | |
parent | 7164775ff1dd6d93ea1029b267d07872a35a62f8 (diff) | |
download | tcl-37d7859f69fa858cde620a429a5616ced9059d3f.zip tcl-37d7859f69fa858cde620a429a5616ced9059d3f.tar.gz tcl-37d7859f69fa858cde620a429a5616ced9059d3f.tar.bz2 |
bug 1225727
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclEvent.c | 17 | ||||
-rw-r--r-- | generic/tclIO.c | 3 | ||||
-rw-r--r-- | generic/tclInt.h | 3 |
3 files changed, 20 insertions, 3 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 059871c..81b6b2d 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEvent.c,v 1.28.2.9 2004/07/30 15:15:57 dgp Exp $ + * RCS: @(#) $Id: tclEvent.c,v 1.28.2.10 2005/06/22 19:35:15 kennykb Exp $ */ #include "tclInt.h" @@ -895,11 +895,26 @@ Tcl_Finalize() TclResetFilesystem(); /* + * There have been several bugs in the past that cause + * exit handlers to be established during Tcl_Finalize + * processing. Such exit handlers leave malloc'ed memory, + * and Tcl_FinalizeThreadAlloc or Tcl_FinalizeMemorySubsystem + * will result in a corrupted heap. The result can be a + * mysterious crash on process exit. Check here that + * nobody's done this. + */ + + if ( firstExitPtr != NULL ) { + Tcl_Panic( "exit handlers were created during Tcl_Finalize" ); + } + + /* * There shouldn't be any malloc'ed memory after this. */ #if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) && !defined(TCL_MEM_DEBUG) && !defined(PURIFY) TclFinalizeThreadAlloc(); #endif + TclFinalizeMemorySubsystem(); inFinalize = 0; } diff --git a/generic/tclIO.c b/generic/tclIO.c index 46ebf28..f983a9a 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.61.2.10 2005/04/14 07:10:06 davygrvy Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.61.2.11 2005/06/22 19:35:16 kennykb Exp $ */ #include "tclInt.h" @@ -274,6 +274,7 @@ TclFinalizeIOSubsystem() statePtr->flags |= CHANNEL_DEAD; } } + TclpFinalizePipes(); } diff --git a/generic/tclInt.h b/generic/tclInt.h index c0f1982..23bd5aa 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.118.2.13 2005/06/22 16:49:28 andreas_kupries Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.118.2.14 2005/06/22 19:35:18 kennykb Exp $ */ #ifndef _TCLINT @@ -1721,6 +1721,7 @@ EXTERN int TclpDeleteFile _ANSI_ARGS_((CONST char *path)); EXTERN void TclpFinalizeCondition _ANSI_ARGS_(( Tcl_Condition *condPtr)); EXTERN void TclpFinalizeMutex _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); +EXTERN void TclpFinalizePipes _ANSI_ARGS_((void)); EXTERN void TclpFinalizeThreadData _ANSI_ARGS_(( Tcl_ThreadDataKey *keyPtr)); EXTERN void TclpFinalizeThreadDataKey _ANSI_ARGS_(( |