Am 06.04.2005 um 21:07 schrieb Stephen Deasey:

There have been some changes in this area of Tcl.  Just a very quick
scan brought up this, which is tagged 8.4.7:

http://cvs.sourceforge.net/viewcvs.py/tcl/tcl/unix/tclUnixThrd.c? r1=1.23.2.6&r2=1.23.2.7

Stephen, you were on the right track!
I somehow messed up with testing but indeed, the problem
is introduced in 8.4.7 for the first time. The problematic
spot is the new TclpFreeAllocCache(ptr) call in unix/tclUnixThrd.c
where some aggressive cleanup has been introduced which screwed
something up. I will have to understand what the people wanted
to achieve by this and after figuring this out, I will fix that
for 8.4.10 (if it comes out).

See:

void TclpFreeAllocCache(ptr)
    void *ptr;
{
    extern void TclFreeAllocCache(void *);

    TclFreeAllocCache(ptr);
    /*
     * Perform proper cleanup of things done in TclpGetAllocCache.
     */
    if (initialized) {
        pthread_key_delete(key);
        initialized = 0;
    }
}

If you rewrite it:

void TclpFreeAllocCache(ptr)
    void *ptr;
{
    extern void TclFreeAllocCache(void *);

    TclFreeAllocCache(ptr);
}

it does not leak any more.

So, I suppose, I go back to electronic archeology again...

Cheer's
Zoran


Reply via email to