Closed
Bug 205023
Opened 22 years ago
Closed 21 years ago
nsTraceRefcnt::LogAddCOMPtr and LogReleaseCOMPtr missing in debug buld
Categories
(SeaMonkey :: Build Config, defect)
SeaMonkey
Build Config
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: colin, Assigned: dougt)
References
Details
Attachments
(1 file)
149.97 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
Similar to bug 205013, I have more missing symbols from my debug build. Again,
this is not new, I'm just trying to fix them now.
nsTraceRefcnt::LogAddCOMPtr and nsTraceRefcnt::LogReleaseCOMPtr are referenced
in the link of regxpcom and mozilla-bin, but neither are present. Where are they
meant to be?
Reporter | ||
Comment 1•22 years ago
|
||
nsTraceRefcnt::LogAddCOMPtr and nsTraceRefcnt::LogReleaseCOMPtr do not exist in
libxpcomglue, and that's where the link of regxpcom and mozilla-bin are looking
for them.
Who is referencing these in a debug build? Both are referenced by:
void nsCOMPtr<nsIServiceManager >::assign_from_helper(const nsCOMPtr_helper &,
const nsID &)
void **nsCOMPtr<nsIServiceManager >::begin_assignment()
Brendan, as a designated XPCOM expert, should these be in libxpcomglue, or is
something else amiss?
(ignore my earlier comment, I think this is a new bug for mozilla-bin,
introduced when GRE_BUILD was added).
Comment 2•22 years ago
|
||
This looks like something for dougt.
Why isn't anyone seeing this outside of OpenVMS? Dbaron said it sounded like
what you get when you mix debug and non-debug libraries in a build.
/be
Assignee: mozbugs-build → dougt
Assignee | ||
Comment 3•22 years ago
|
||
Hi Colin,
See bug: http://bugzilla.mozilla.org/show_bug.cgi?id=151072
Reporter | ||
Comment 4•22 years ago
|
||
> Why isn't anyone seeing this outside of OpenVMS?
It could be something that's going wrong on the OpenVMS build, that's for sure.
But I've looked carefully at a link map (shows exactly what getting pulled in by
the linker) and everything is coming from the debug tree. No opt in sight. I
guess its possible that something is the debug tree is getting built without
some necessary debug flag. Is the only important one -DDEBUG?
> Dbaron said it sounded like what you get when you mix debug and non-debug
> libraries in a build.
I'll keep looking, but like I said above...
Reporter | ||
Comment 5•22 years ago
|
||
> See bug: http://bugzilla.mozilla.org/show_bug.cgi?id=151072
What am I looking at exactly, there? That bug was fixed nine months ago.
Reporter | ||
Comment 6•22 years ago
|
||
Dbaron was right. Give that man a cigar.
At some point when I had been trying to fix bug 205013 (another xpcom debug
build bug) I must have accidently built some of the glue modules without the
-DDEBUG stuff, and that's what was causing this problem. And because it was a
compile mistake and not a link mistake, that's why I couldn't see anything amiss
in the map.
Sorry for the false alarms.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 7•22 years ago
|
||
I do still have a link problem. I wasn't losing it before. Here's the problem.
I kick off a full debug build. xpcom/tools/registry fails to link regxpcom
because nsTraceRefcnt::LogAddCOMPtr and nsTraceRefcnt::LogReleaseCOMPtr are
missing. These are referenced from some template code (can't tell what
referenced those templates because all generated template code gets bundled into
the same location).
Anyway, I found that if I go back to xpcom/glue and rebuild then, I can then
link regxpcom without a problem and the rest of the build continues of its merry
way.
Until mozilla-bin. That fails with the same missing symbols. The building
xpcom/glue trick doesn't work here, so some other directory is generating the
"bad" template code.
This is where we are in Mozilla when we hit the "missing code":
#ifdef NSCAP_FEATURE_DEBUG_PTR_TYPES
private:
void assign_with_AddRef( nsISupports* );
void assign_from_helper( const nsCOMPtr_helper&, const nsIID& );
void** begin_assignment();
void
assign_assuming_AddRef( T* newPtr )
{
T* oldPtr = mRawPtr;
mRawPtr = newPtr;
--> NSCAP_LOG_ASSIGNMENT(this, newPtr);
NSCAP_LOG_RELEASE(this, oldPtr);
if ( oldPtr )
NSCAP_RELEASE(this, oldPtr);
}
And here's the calls which got us there:
DBG> sho call
*CXX$assgnfrmhlpr30nsCMPt168efgo
assign_assuming_AddRef
*CXX$assgnfrmhlpr30nsCMPt168efgo
assign_from_helper
*NSXPCOMGLUE nsCOMPtr(const nsQueryInterface &)
*NSXPCOMGLUE Assert_NoQueryNeeded
*NSXPCOMGLUE ~nsGetterAddRefs
*NSXPCOMGLUE GRE_Startup
*NSAPPRUNNER main
*NSAPPRUNNER __MAIN
*SHARE$PTHREAD$RTL
*SHARE$PTHREAD$RTL
DBG>
Can someone tell me what's going on!!!
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Reporter | ||
Comment 8•22 years ago
|
||
Because XPCOM_GLUE is defined in xpcom/tools/registry's Makefile, this causes
NS_BUILD_REFCNT_LOGGING to get UNdefined:
http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsTraceRefcnt.h#73
This means the LogAddRef etc are NOT referenced any more, and so (I think this
is what's happening) the code for LogAddRef and friends is NOT created in the
template code BUT when regxpcom is linked we suck in some other code which DOES
expect LogAddRef and friends to exist in the template code.
I suspect I could work around this by performing my debug builds with
--disable-logrefcnt, but I'd rather fix the root problem if possible.
I'd think the right solution would be what I suggested in bug 193585 comment 12
-- which really applies to nsTraceRefcnt and nsDebug.
Reporter | ||
Comment 10•22 years ago
|
||
Marking "depends on 193585" (not 100% its a dupe at this point).
Depends on: 193585
Assignee | ||
Comment 11•22 years ago
|
||
similar to what we just did for nsDebug. This patch is missing some changes to
areas outside of mozilla/xpcom. Those changes are basically,
s/nsTraceRefcnt/nsTraceRefcntImpl.
commments welcom.
Assignee | ||
Updated•22 years ago
|
Attachment #127378 -
Flags: review?(dbaron)
Assignee | ||
Updated•22 years ago
|
Flags: blocking1.5a?
I don't see why this should block 1.5alpha. We've shipped with this before. Or
am I missing something?
Flags: blocking1.5a? → blocking1.5a-
Assignee | ||
Comment 13•22 years ago
|
||
Comment on attachment 127378 [details] [diff] [review]
patch v.1
dbaron, can you review today?
Comment on attachment 127378 [details] [diff] [review]
patch v.1
It would be good to at least do a repository copy of nsTraceRefcnt.{h,cpp} to
nsTraceRefcntImpl{h,cpp} before landing (and maybe to the new nsTraceRefcnt.h
location as well).
>Index: build/dlldeps.cpp
I don't understand why you changed exactly what you did, but then again, I
don't really understand this file at all...
>Index: build/nsXPComInit.cpp
>+nsresult NS_COM NS_GetTraceRefcnt(nsITraceRefcnt** result)
>+{
>+#ifdef NS_BUILD_REFCNT_LOGGING
>+ nsresult rv = NS_OK;
>+ if (!gTraceRefcnt)
>+ {
>+ rv = nsTraceRefcntImpl::Create(nsnull,
>+ NS_GET_IID(nsITraceRefcnt),
>+ (void**)&gTraceRefcnt);
>+ }
>+ NS_IF_ADDREF(*result = gTraceRefcnt);
>+ return rv;
>+#else
>+ return NS_ERROR_NOT_INITIALIZED;
Maybe NS_ERROR_NOT_AVAILABLE would make more sense?
>+#endif
>+}
>Index: glue/nsTraceRefcnt.cpp
>+#define ENSURE_TRACEOBJECT \
Did you mean to define this to be something? (Something needs to call
SetupTraceRefcntObject for the non-glue case, if that code ever gets used
(which I think it does on some platforms), but you don't want to do it multiple
times.)
I'll give r=dbaron once I see how you address this last issue.
Assignee | ||
Comment 15•22 years ago
|
||
dbaron, not sure what happened with the patch, but ENSURE_TRACEOBJECT is defined as:
(gTraceRefcntObject ? PR_TRUE : (PRBool)(SetupTraceRefcntObject() != nsnull))
This is similar to what we do for the nsMemory case. I am going to rediff...
stay tuned.
> (gTraceRefcntObject ? PR_TRUE : (PRBool)(SetupTraceRefcntObject() != nsnull))
That would be written much more cleanly as:
(gTraceRefcntObject || SetupTraceRefcntObject() != nsnull)
With that and my other comments addressed, r=dbaron.
Attachment #127378 -
Flags: review?(dbaron) → review+
Comment 17•21 years ago
|
||
It looks like this landed on 08/05. If so, can we resolve this bug?
Assignee | ||
Comment 18•21 years ago
|
||
yup.
Status: REOPENED → RESOLVED
Closed: 22 years ago → 21 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•