Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d70f0147ba4b7373d9d716a40aca1af1db95280a
Ticket: 731754ffffffffffffffffffffffffffffffffff
tls index leak/inconsistencies in tclThreadAlloc.c, etc
User & Date: nobody on 2003-05-03 09:00:35
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    In the CVS HEAD version of tclThreadAlloc.c, near 
    line #279, the following lines of code can be found:
    
    #ifdef WIN32
        TlsFree((DWORD) cachePtr);
    #else
        free(cachePtr);
    #endif
    
    After seeing this code and, I investigated it more 
    carefully to see if I could more precisely figure out 
    it's implications.  Here are my preliminary 
    conclusions:
    
    #1. It turns out that calling TlsFree on cachePtr is 
    NOT correct.
    
    #2. Calling free() on it produces a very strange 
    crash in PutBlocks (null pointer dereference on line 
    826).
    
    #3. In an attempt to fix this problem, I moved the 
    call to TlsFree to tclWinThrd.c, where it really 
    belongs anyhow. However, calling TlsFree on 
    the "key" static variable in this file, which is what 
    cachePtr is based on, does not produce good 
    results.
    
    I am not sure how to fix this problem because I 
    believe it may point to deeper issues with the 
    threaded memory allocator. Any help on this issue, 
    and more generally, my non-TLS patch, would be 
    greatly appreciated.
    
    If indeed TlsFree (or it's new non-TLS equivalent) 
    must be called from tclThreadAlloc.c, it would 
    make my patch a lot cleaner if TclFreeAllocCache 
    called into a wrapper function residing in 
    tclWinThrd.c, where I can use my new non-TLS 
    thread storage subsystem if necessary.
    
    JJM
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "49. Threading"
  10. title changed to: "inconsistencies in tclThreadAlloc.c, etc"
  11. type changed to: "Bug"