Closed
Bug 218846
Opened 21 years ago
Closed 17 years ago
The primordial thread is attached again in _PR_CleanupIO in PR_Cleanup.
Categories
(NSPR :: NSPR, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
4.7.1
People
(Reporter: wtc, Assigned: wtc)
References
Details
Attachments
(1 file, 1 obsolete file)
1.53 KB,
patch
|
Details | Diff | Splinter Review |
This bug is in the NSPR classic code base. I haven't
looked at the pthread version to see if it also has
this bug.
In PR_Cleanup, we first set the current thread to NULL
(in _PR_MD_EXIT_THREAD) and then call _PR_CleanupIO.
But _PR_CleanupIO calls PR_Lock, which attaches the
current thread again. Here is the stack trace:
=>[1] _PRI_AttachThread(type = RW_WRITER, priority = PR_PRIORITY_NORMAL, stack =
(nil), flags = 0), line 1453 in "pruthr.c"
[2] _pr_current_thread_tls(), line 359 in "solaris.c"
[3] PR_Lock(lock = 0x24f50), line 224 in "prulock.c"
[4] _PR_Putfd(fd = 0x22778), line 173 in "prfdcach.c"
[5] PR_FreeFileDesc(fd = 0x22778), line 149 in "prio.c"
[6] _PR_CleanupIO(), line 80 in "prio.c"
[7] PR_Cleanup(), line 453 in "prinit.c"
[8] main(argc = 1, argv = 0xffbef90c), line 409 in "foreign.c"
Seems that we need to move the _PR_MD_EXIT_THREAD call near the
end of the PR_Cleanup call.
Assignee | ||
Comment 1•21 years ago
|
||
*** Bug 222709 has been marked as a duplicate of this bug. ***
Comment 2•21 years ago
|
||
PR_Cleanup must be slightly reordered: threads must be cleaned-up *AFTER*
CleanupIO(), as CleanupIO() does a _pr_current_thread_tls.
Comment 3•21 years ago
|
||
Sorry for the delay. We have been successfully using the proposed patch (for
NSPR version 4.3) since beginning of March.
Updated•18 years ago
|
QA Contact: wtchang → nspr
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → 4.7.1
Assignee | ||
Comment 4•17 years ago
|
||
To fix the memory leaks in PR_Cleanup, we must move the _PR_CleanupIO call
before the _PR_MD_EXIT_THREAD(me) call. I moved _PR_CleanupIO (and
_PR_CleanupNet) further up, before where we start to clean up the current thread.
I checked in this patch (a variant of Gerard's patch) on the NSPR trunk (NSPR 4.7.1).
Checking in prinit.c;
/cvsroot/mozilla/nsprpub/pr/src/misc/prinit.c,v <-- prinit.c
new revision: 3.49; previous revision: 3.48
done
Attachment #154971 -
Attachment is obsolete: true
Assignee | ||
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•