Closed Bug 62006 Opened 24 years ago Closed 15 years ago

assertions about static ctors

Categories

(Core :: XPCOM, defect, P4)

x86
Linux
defect

Tracking

()

RESOLVED WORKSFORME
Future

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

Attachments

(1 file)

It wouldn't be hard to cause assertions for *most* cases where people use statically constructed XPCOM objects. It could be done by: * adding (if they aren't there already) methods to nsTraceRefcnt to access the number of bytes allocated and the number freed * checking that these numbers don't change around: * calls to PR_LoadLibrary and PR_UnloadLibrary in nsDll * all atexit functions (since that's how statics in function scope are implemented on Linux, at least), by writing 2 functions, one called atexit() in NS_InitXPCOM2, and the other in NS_ShutdownXPCOM, that compare the numbers between when these 2 are called.
Target Milestone: --- → mozilla1.0.1
This has been checked in (see bug 61243) but not yet enabled.
Well, I now have enough of these removed in my tree to see that there are threadsafety problems with this patch (wow, what a surprise). Perhaps the way to fix the problem is to store the thread on which we're loading a library and only assert if the allocation is on that thread too...
Status: NEW → ASSIGNED
Target Milestone: mozilla1.0.1 → Future
QA Contact: kandrot → nobody
QA Contact: nobody → xpcom
I think this is working now, threadsafely even.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: