Closed Bug 50945 Opened 26 years ago Closed 17 years ago

XPCOM shutdown does not free thread local storage

Categories

(Core :: XPCOM, defect, P3)

x86
All
defect

Tracking

()

RESOLVED INCOMPLETE
Future

People

(Reporter: jonsmirl, Unassigned)

References

Details

(Keywords: topembed-)

If I reuse a thread in a new XPCOM session after shutting down an old one. The old thread local storage is still attached to the thread. This results in a GPF at the NS_ADDREF at the bottom of the code snippet. nsIThread::GetIThread(PRThread* prthread, nsIThread* *result) thread = (nsThread*)PR_GetThreadPrivate(nsThread::kIThreadSelfIndex); if (thread == nsnull) { // if the current thread doesn't have an nsIThread associated // with it, make one thread = new nsThread(); if (thread == nsnull) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(thread); // released by Exit thread->SetPRThread(prthread); nsresult rv = thread->RegisterThreadSelf(); if (NS_FAILED(rv)) return rv; } NS_ADDREF(thread);
setting Jon Smirl's bugs to New
Status: UNCONFIRMED → NEW
Ever confirmed: true
Transferring to default XPCOM owner.
Assignee: rayw → warren
Moving Warren's thread bugs from his circular file to mine, because I was told it was the thing to do. Anyone who actually wants these bugs, now, feel free to correct my hastiness.
Assignee: warsome → danm
I think the new co-owner of xpcom wants this one...
Assignee: danm → kandrot
QA Contact: leger → kandrot
I accept this bug. I do not know what this bug refers to though, so I would appreciate some help. Is the code snippet in our product, or is this accessed in some other way? It sounds like some other way to me, so if this is true, is there a complete sample of how this code would be done (a sample.cpp and makefile), so I can focus on fixing the bug and not how to create the bug. Thanks.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
This problem only appears if you try to shutdown XPCOM and then start it up again. I believe the decision has been made to not allow this. For example NSPR is not properly shutdown when XPCOM is shutdown. The problem is that each thread under XPCOM is getting allocated TLS storage. When XPCOM shuts down the TLS memory is not being freed. When I re-inited XPCOM, XPCOM tries to allocate the TLS memory again, but it is already there and a GPF results. This is a related bug http://bugzilla.mozilla.org/show_bug.cgi?id=45068 My application used xpcom in a DLL from the Apache web server. Apache will unload a dll and then load it again latter. This triggers the shutdown/reinit to XPCOM. I have since modified the Apache source code not to do this and I run a private version of Apache.
Target Milestone: mozilla0.9 → mozilla0.9.1
moving non-beta stoppers of the 0.9.1 list
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Target Milestone: mozilla0.9.2 → mozilla1.0
reassign all kandrot xpcom bug.
Assignee: kandrot → dougt
Status: ASSIGNED → NEW
Target Milestone: mozilla1.0 → ---
Blocks: 98283
Target Milestone: --- → mozilla1.1
Target Milestone: mozilla1.1alpha → Future
Keywords: topembed+
per discussion w/ dougt, topembed minusing this bug.
Keywords: topembed+ → topembed-
Depends on: 316414
QA Contact: kandrot → nobody
Assignee: dougt → nobody
QA Contact: nobody → xpcom
OS: Other → All
(In reply to comment #6) > This is a related bug http://bugzilla.mozilla.org/show_bug.cgi?id=45068 Reading bug 45068 comment 0, and without knowing much about these things, I wonder what makes these two bugs *not* duplicate ? May be bug 45068 summary needs to be more specific ?
Depends on: 45068
restartable XPCOM is not on the radar now
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.