Artifacts Associated With Ticket 990453ffffffffff
Ticket change [85daa92ad6] (rid 131393) by mistachkin on 2004-07-13 20:45:10:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The code in TclpFinalizeMutex on Unix currently reads: if (pmutexPtr != NULL) { ckfree((char *)pmutexPtr); *mutexPtr = NULL; } It should read: if (pmutexPtr != NULL) { pthread_mutex_destroy(pmutexPtr); ckfree((char *)pmutexPtr); *mutexPtr = NULL; } This change fixes quite a few memory leaks in HEAD. I believe this fix should be backported to core-8-4-branch as well. - foundin initialized to: "obsolete: 8.4.6"
- priority initialized to: "7 High"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mistachkin"
- subsystem initialized to: "49. Threading"
- title initialized to: "leaking mutexes on Unix"
- type initialized to: "Bug"
Ticket change [22b896cf0e] (rid 130802) by andreas_kupries on 2004-07-16 05:04:55:
- icomment:
Logged In: YES user_id=75003 Accepted. Conditions and Attrs use their destroy function as well, and all the docs I find make the desotry complement to init, which is used for mutexes. Committed fix to 8.4 and head.
- login: "andreas_kupries"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "andreas_kupries"
- icomment:
Ticket change [a49c52a16c] (rid 110236) by andreas_kupries on 2004-07-16 05:04:56:
- closedate changed to: "2004-07-15T22:04:56"
- closer changed to: "andreas_kupries"
Ticket change [614c66b5c2] (rid 92218) by dossy on 2004-08-25 18:44:38:
- icomment:
Logged In: YES user_id=21885 The dangerous thing about this is that pthread_mutex_destroy () on some platforms will cause a crash if the mutex is locked. So, destroying mutexes introduces a kind of "race condition" -- the thread that wants to destroy the mutex cannot guarantee that another thread doesn't have the mutex locked without locking the mutex itself, but once it's locked the mutex, it cannot destroy it because now the mutex is locked. See AOLserver Bug #810799 for a discussion on this. Destroying a locked mutex definitely crashes Linux (not sure if it's LinuxThreads or NPTL or both) but doesn't seem to crash on Solaris, but the manpages for both indicate that a mutex should be unlocked before executing pthread_mutex_destroy ().
- login: "dossy"
- mimetype: "text/plain"
- username: "dossy"
- icomment: