Closed Bug 43591 Opened 24 years ago Closed 24 years ago

nsBasicDecoderSupport held past XPCOM shutdown in nsFSStringConversion

Categories

(Core :: XPCOM, defect, P3)

x86
Windows 98
defect

Tracking

()

RESOLVED FIXED
mozilla0.9

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Keywords: memory-leak, topembed+, Whiteboard: [tind-mlk])

Attachments

(4 files)

An nsCOMPtr<nsIUnicodeDecoder> pointing to an nsBasicDecoderSupport is held 
past XPCOM shutdown by the global variable "nsFSStringConversion gConverter" 
defined at:
http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsLocalFileCommon.cpp#124
See bug 43561 for more info.
This object holds on to an nsUnicodeDecodeHelper too.
Summary: nsBasicDecoderSupport held past XPCOM shutdown → nsBasicDecoderSupport held past XPCOM shutdown in nsFSStringConversion
Whiteboard: [tind-mlk]
My first guess is that this is a string issue that scc would handle better than
I.  Reassigning to scc.
Assignee: rayw → scc
Un-related to string stuff, Ray.  This is just an ordinary case of someone 
keeping an owning reference in a static global, which delays the referents 
destruction beyond the point where needed resources are already gone.  You need 
to figure out a way to shorten its lifetime.
Assignee: scc → rayw
I can create a listener to shorten the lifecycle, if everyone is willing to live 
without conversion services in the I/O subsystem after xpcom shuts down.

Is there a document describing which services should be available when?

This seems to be part of the bigger question of whether string conversion 
services should be tied to the initialization state of XPCOM.

Scott, any opinions?  Am I owner of file I/O and string conversion services, so 
I should fix it?
I think this has been mistagged as a memory leak.  It is one case where XPCOM 
file I/O does not release all resources during shutdown, and it is not clear 
that it should.  This may get cleared up if we can get time to better-describe 
XPCOM lifecycle and relationship to conversion facilities.  Marking futute.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
I think we are willing to live without any but the basic conversions (between 
UTF8, ASCII, and UCS2 or whatever our double-byte format is) which I will ensure 
live outside the range of XPCOM initialization.
Then we will have no conversion between native filesystem names and unicode.
Blocks: 38671
can't we make this a static raw ptr and let some service w/ scope release it 
when it goes away?
Keywords: nsbeta3
Why is it a static global variable if it is owned by some other object with 
scope which comes and goes?  We seem to lack an object model and discipline to 
do it this way.  I do not think spaghetti interdependencies help us.

If it is a static variable that must be managed by the scope of some singleton 
object, it should be in the scope of that singleton object.
Edward: Welcome to xpcom!
Status: ASSIGNED → NEW
QA Contact: leger → rayw
Target Milestone: Future → mozilla1.0
Once again... attempting to reassign from Ray to Edward.
Assignee: rayw → kandrot
It seems the above patch also fixes bug 49575 (probably because OpenBSD has
problems with static constructors).
nice work.  David, you should add an NS_StartUpLocalFile that basically noops to
compilment the NS_ShutdownLocalFile.  or you could also allocate this class in
the heap in this startup method...

Fix this and you have an r=dougt
dougt:  Where in NS_InitXPCOM2 would you want NS_StartupLocalFile to be called?
 Without knowing what it would do, I'm not sure where to put it.

(While I'm here, assigning the bug to myself since I'm working on a fix.)
Assignee: kandrot → dbaron
Put it as early as possible; after the nsMemoryImpl::Startup would be perfect. 
It would be for system initialization.  For example, I would like to factor out 
(on windows) the CoInitialize and CoUninitialize.  

r=dougt.  

--> SCC <-- can you please approve this change?
Chris could you approved this leak fix?  
Target Milestone: mozilla1.0 → mozilla0.9
sr=waterson
Fix checked in 2000-12-08 20:11 PST.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Your fix broke XPCOM_STANDALONE. I'll attach a patch. If I can get a quick r=
and sr= I'll check it in and reclose this bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
r or sr=brendan@mozilla.org on jband's XPCOM_STANDALONE patch.

/be
duh!  sorry about that jband.  thanks for the quick patch.
dougt: turn that 'duh!' into an r= and I'll check it in when the tree clears.
r=dbaron  Sorry about that.
No problem. Thanks for the quick reviews. Fix to XPCOM_STANDALONE checked in.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
*** Bug 58174 has been marked as a duplicate of this bug. ***
Keywords: topembed+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: