In a message dated 4/3/2001 12:00:12 AM Eastern Daylight Time,
[EMAIL PROTECTED] writes:
>
> Date: Mon, 2 Apr 2001 15:38:13 -0500
> From: Rob Mayoff <[EMAIL PROTECTED]>
> Subject: test case for 3.3.1 crash?
>
> Recently there was discussion of 3.3.1 crashing due to improper adoption
> of Zoran's memory leak patch. Does anyone have a simple test case for
> this? I am working on the ArsDigita release of 3.3.1 and I need to fix
> the problem.
I believe, on my 4th attempt, I may have correctly implemented Zoran's
patches to the 3.3.1 code to avoid the crash. I've moved the nsthread
support code from libnsthread.a to the Tcl library where it belongs (putting
it in nsthreads was a hack). I think the code should now work just like
Tcl's direct Win32 and Unix implementations. This fix is in both the 3.3
brand (which you check out with the somewhat confusion name -r nsd_v3_r3_p0)
and also in the head 4.0 code.
Basically, the problem revolved around the different thread local storage
models. AOLserver uses a pthread-like model where thread local storage slots
are registered with specific cleanup functions and these functions run, in
reverse order and multiple times if necessary to clear out the slots. You
can see this at work in the thread/tls.c file. Tcl, on the other hand, uses
it's own model which relies on registered thread exit-time handlers which are
called just once and then a simple free of all other allocated blocks. I was
stupidly assuming just using aolserver's tls cleanup mechanism for the blocks
would work as well as Tcl freeing the blocks explicitly at the end of
Tcl_FinalizeThread. Unfortunately, Tcl_FinalizeThread itself is kicked off
by an aolserver cleanup which would run after, not before, the block cleanups
in my broken solution.
Hopefully all is well now. This stuff has to work now - Tcl 7.6 has been
ripped out of 4.0 altogether!
-Jim