Tcl Source Code

View Ticket
Login
Ticket UUID: 414419
Title: async.test crashes with a threaded build
Type: Bug Version: obsolete: 8.4a2
Submitter: davygrvy Created on: 2001-04-06 21:45:35
Subsystem: 49. Threading Assigned To: davygrvy
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2001-08-30 14:53:12
Resolution: Fixed Closed By: davygrvy
    Closed on: 2001-08-30 07:53:12
Description:
as reported by sreangsu acharyya 
<[email protected]> on c.l.t:

$ tcltest
% proc async1 {result code} {
    global aresult acode
    set aresult $result
    set acode $code
    return "new result"
}
%
% testasync create async1
segmenation violation


In the TSD structure in tclAsync.c is a mutex.
TclFinalizeSynchronization happens to clear the TSD
before the mutex.
User Comments: davygrvy added on 2001-08-30 14:53:12:
Logged In: YES 
user_id=7549

committed "a better proposal" to core.

davygrvy added on 2001-08-30 13:03:24:

File Deleted - 5250:

davygrvy added on 2001-04-12 08:03:23:

File Added - 5255: patch.txt

Logged In: YES 
user_id=7549

Instead of changing the order in TclFinalizeSyncronization
(), I think this patch might be the more proper way to go 
as the mutex will be deleted from Tcl_FinalizeThread() 
which seems more correct.

davygrvy added on 2001-04-12 08:02:06:

File Added - 5254: patch.txt

Logged In: YES 
user_id=7549

Instead of changing the order in TclFinalizeSyncronization
(), I think this patch might be the more proper way to go 
as the mutex will be deleted from Tcl_FinalizeThread() 
which seems more correct.

davygrvy added on 2001-04-12 08:00:57:

File Added - 5253: patch.txt

Logged In: YES 
user_id=7549

Instead of changing the order in TclFinalizeSyncronization
(), I think this patch might be the more proper way to go 
as the mutex will be deleted from Tcl_FinalizeThread() 
which seems more correct.

davygrvy added on 2001-04-12 08:00:30:

File Added - 5252: patch.txt

Logged In: YES 
user_id=7549

Instead of changing the order in TclFinalizeSyncronization
(), I think this patch might be the more proper way to go 
as the mutex will be deleted from Tcl_FinalizeThread() 
which seems more correct.

davygrvy added on 2001-04-12 07:59:25:

File Added - 5250: patch.txt

Logged In: YES 
user_id=7549

Instead of changing the order in TclFinalizeSyncronization
(), I think this patch might be the more proper way to go 
as the mutex will be deleted from Tcl_FinalizeThread() 
which seems more correct.

davygrvy added on 2001-04-12 07:58:32:

File Added - 5249: patch.txt

Logged In: YES 
user_id=7549

Instead of changing the order in TclFinalizeSyncronization
(), I think this patch might be the more proper way to go 
as the mutex will be deleted from Tcl_FinalizeThread() 
which seems more correct.

davygrvy added on 2001-04-07 05:09:54:

File Added - 5090: free_mutex_missing.txt

davygrvy added on 2001-04-07 05:09:52:
Logged In: YES 
user_id=7549

although the async.test failure is on unix only, I noticed 
a missing cleanup of criticalsections on windows.  see 
patch.  and might be a factor with

http://sourceforge.net/tracker/index.php?
func=detail&aid=406058&group_id=10894&atid=110894

davygrvy added on 2001-04-07 04:53:36:
Logged In: YES 
user_id=7549

I'm not sure which is right.  The notifier stores mutexes 
in its TSD, but has FinalizeNotifier() to do the needed 
cleanup.  We could have a new cleanup routine 
FinalizeAsync, or have remembered mutexes cleaned prior to 
thread specific data...  I'm not sure if changing the order 
in TclFinalizeSynchronization() has any bad effects.  None 
observed on windows.

davygrvy added on 2001-04-07 04:45:45:

File Added - 5088: mutex_crash_in_async.txt

Attachments: