Artifacts Associated With Ticket 731754ffffffffffffffffffffffffffffffffff
Ticket change [d70f0147ba] (rid 123912) by nobody on 2003-05-03 09:00:35:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized 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 - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "49. Threading"
- title initialized to: "inconsistencies in tclThreadAlloc.c, etc"
- type initialized to: "Bug"
Ticket change [7abdf9cba3] (rid 90382) by mistachkin on 2003-05-03 16:01:56:
- assignee changed to: "msofer"
- priority changed to: "7 High"
Ticket change [e251387b14] (rid 87601) by mistachkin on 2003-05-03 18:17:53:
- icomment:
Logged In: YES user_id=113501 Apparently, the TLS index for the threaded memory allocator is never freed. Therefore, it is being leaked upon load/unload/reload of the Tcl DLL.
- login: "mistachkin"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- title changed to:
tls index leak/inconsistencies in tclThreadAlloc.c, etc
- username: "mistachkin"
- icomment:
Ticket change [45f80aabe9] (rid 99435) by msofer on 2003-05-04 00:02:02:
- assignee changed to: "mistachkin"
- icomment:
Logged In: YES user_id=148712 Back to Joe: I have no relevant knowledge on these matters :(
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
Ticket change [523f75e6e0] (rid 126282) by mistachkin on 2003-05-05 13:13:41:
- assignee changed to: "hobbs"
- icomment:
Logged In: YES user_id=113501 It appears, based on CVS history, that this is JeffH's area. Assigning to him.
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
Ticket change [cf0145ee7c] (rid 112884) by mistachkin on 2003-05-05 13:15:26:
- icomment:
Logged In: YES user_id=113501 This bug is fixed in my Win32 NON-Tls thread storage patch. patch #731356
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [2d0c2fe37b] (rid 119013) by mistachkin on 2003-05-10 05:49:34:
- assignee changed to: "mistachkin"
Ticket change [1670ce898e] (rid 124720) by mistachkin on 2003-05-10 06:38:02:
- closedate changed to: "2003-05-09T23:38:02"
- closer changed to: "mistachkin"
- icomment:
Logged In: YES user_id=113501 Memory leak fixed. all platforms now call: free(cachePtr); The more general problem of when to free the TLS index for the threaded memory allocator has been solved by my Win32 non-TLS patch. However, I'm in the middle of reworking it to make it more modular before it's committed.
- login: "mistachkin"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "mistachkin"