Closed
Bug 220291
Opened 22 years ago
Closed 22 years ago
mixing DEBUG and non-DEBUG leaks due to ~nsCOMPtr_base() hack
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
Attachments
(1 file, 1 obsolete file)
8.58 KB,
patch
|
scc
:
review+
bryner
:
superreview+
asa
:
approval1.6a+
|
Details | Diff | Splinter Review |
The fix for bug 77112 causes a mix of DEBUG and non-DEBUG code to leak. (The
fix made it link, but once the fix applies, it leaks.) I commented on this
possibility in bug 217009 comment 2, and it was independently discovered as a
real problem (see news://news.mozilla.org:119/bkusf2$iko3@ripley.netscape.com ).
I think the easiest way to fix this based on the observation that
NSCAP_FEATURE_FACTOR_DESTRUCTOR and NSCAP_FEATURE_DEBUG_PTR_TYPES are currently
exact opposites, so the ifdef-ing of the destructor was never really needed,
with the exception of the nsCOMPtr<nsISupports> specialization. I think we
should merge the two macros into something like NSCAP_FEATURE_USE_BASE, and have
nsCOMPtr_base always have a destructor that does releasing. This will require
some changes to the nsCOMPtr<nsISupports> specialization in addition to the
merging of the macros.
Thoughts?
Assignee | ||
Updated•22 years ago
|
Summary: mixing DEBUG and non-DEBUG causes leaks → mixing DEBUG and non-DEBUG leaks due to ~nsCOMPtr_base() hack
Assignee | ||
Comment 1•22 years ago
|
||
Assignee | ||
Updated•22 years ago
|
Attachment #132165 -
Attachment is obsolete: true
Assignee | ||
Comment 2•22 years ago
|
||
Assignee | ||
Comment 3•22 years ago
|
||
Comment on attachment 132167 [details] [diff] [review]
possible patch
scc, opinions on this? The part I'm least comfortable with is the change to
the nsCOMPtr<nsISupports> specialization -- perhaps that should have the same
code as the general template, and only conditionally use nsCOMPtr_base?
Attachment #132167 -
Flags: review?(scc)
*** Bug 220985 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 5•22 years ago
|
||
Might be good to get this in for 1.6alpha so it gets testing with plugins, etc.
Flags: blocking1.6a?
Comment 6•22 years ago
|
||
Comment on attachment 132167 [details] [diff] [review]
possible patch
to my eye, this patch matches your prose description of the fix. Seems like a
reasonable approach, but I think we might want to abandon the idea of having
|nsCOMPtr_base| at all. We will pay a cost for this in total code size, but it
might be reasonable (we should at least check), and we can still factor the
destructors at least among instances of the same type within each compilation
unit. This would forever banish our aliasing problem, if I remember and
understand correctly, and the lack of choices will prevent the linking
mismatch. It may well be worth the (potential, and currently unknown) cost in
code size.
Comment 7•22 years ago
|
||
Comment on attachment 132167 [details] [diff] [review]
possible patch
r=scc, modulo the comments above
Attachment #132167 -
Flags: review?(scc) → review+
Assignee | ||
Comment 8•22 years ago
|
||
The codesize increase on gcc3 from my aliasing fix makes me think that getting
rid of nsCOMPtr_base wouldn't be good for codesize -- although it would be worth
testing with the templatized methods inlined rather than non-inlined.
Assignee | ||
Updated•22 years ago
|
Attachment #132167 -
Flags: superreview?(bryner)
Updated•22 years ago
|
Flags: blocking1.6a? → blocking1.6a+
Updated•22 years ago
|
Attachment #132167 -
Flags: superreview?(bryner) → superreview+
Assignee | ||
Updated•22 years ago
|
Attachment #132167 -
Flags: approval1.6a?
Comment 9•22 years ago
|
||
Comment on attachment 132167 [details] [diff] [review]
possible patch
a=asa (on behalf of drivers) for checkin to 1.6alpha
Attachment #132167 -
Flags: approval1.6a? → approval1.6a+
Assignee | ||
Comment 10•22 years ago
|
||
Fix checked in to trunk, 2003-10-22 16:29 -0700.
I plan to further investigate the inlining issues in bug 212082.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•