Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-12-10
11:16 • Add attachment tclmasterunlock-651139.diff to ticket [651139ffffffffff|... artifact: 02c8fa6a6b user: hobbs
11:16 • Ticket [651139ffff] logic error in tclThread.c status still Closed with 4 ot... artifact: 0359cbde33 user: hobbs
11:16 • Ticket [651139ffff]: 6 changes artifact: 614b987e34 user: hobbs
07:32 • Closed ticket [651139ffff]. artifact: 6dd1aecabd user: hobbs
05:31 • Ticket [651139ffff]: 5 changes artifact: 218d71fe4c user: andreas_kupries
2002-12-09
22:27 • New ticket [651139ffff]. artifact: 1594dbfb95 user: nobody

logic error in tclThread.c

Closed / Fixed651139ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-12-09 22:27:55
While trying to get setup to duplicate that other 
bug (#649209), I discovered a severe logic error in 
the TclFinalizeThreadData function.  This bug is 
somewhat specific to Windows and definitely 
specific to non-threaded builds.  This is the kind 
of bug that could potentially be responsible for 
more than one open bug.

TclpMasterLock is called unconditionally on 
tclThread.c:409, however the accompanying 
TclpMasterUnlock is only called if TCL_THREADS is 
defined.  Of course, this is totally fatal to the 
process, because once the critical section has been 
acquired by one thread, it is forever orphaned and 
according to the Win32 API docs, the results of a 
thread dying while holding a critical section 
are "undefined".  Additionally, TclpMasterUnlock is 
not defined when TCL_THREADS is not defined.  It 
should always be declared, regardless of the 
TCL_THREADS define.  

Fortunately, a cursory search of the Tcl source code 
turned up no other instances of this particular logic 
error.

I can create a patch for this bug if you want, but it 
would involve some work, since my local Tcl 
source is not quite in sync with CVS.

JJM
andreas_kupriesplain2002-12-10 05:31:08
Logged In: YES 
user_id=75003

Also for David G. possibly.
hobbsplain2002-12-10 07:32:21
Logged In: YES 
user_id=72656

This required also that TclpMasterUnlock was not conditional 
to TCL_THREADS in tclWinThrd.c.
hobbsplain2002-12-10 11:16:05
Logged In: YES 
user_id=72656

patch against 8.3.5 for reference attached.  patch commited 
for 8.3.5+ / 8.4.1+.
hobbsplain2002-12-10 11:16:06
File Added - 37243: tclmasterunlock-651139.diff
Log in (anonymous is fine) to add a comment.

Attachments: