Closed Bug 30704 Opened 26 years ago Closed 26 years ago

AddRef/Release assert they are not threadsafe

Categories

(Core :: XPCOM, defect, P3)

PowerPC
Mac System 9.x
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: mikepinkerton, Assigned: danm.moz)

Details

(Keywords: verifyme)

Mac has started asserting a bazillion times at startup because of changes warren made to start using different macros. Here's the log from one of these asserts: Here's the log from MacsBug. User break at 16866310 dprintf(const char*, ...)+0008C ###!!! ASSERTION: nsAppShell not thread-safe: '_mOwningThread == NS_CurrentThread()', file nsAppShell.cpp, line 63 Calling chain using A6/R1 links Back chain ISA Caller 00000000 PPC 174637AC 033E4B00 PPC 1744E404 main+001C0 033E4A70 PPC 1744C704 main1(int, char**, nsISplashScreen*)+002BC 033E4980 PPC 17318D04 nsAppShellService::Initialize(nsICmdLineService*, nsISplashScree n*)+18D04 033E4900 PPC 16863A1C nsComponentManager::CreateInstance(const nsID&, nsISupports*, co nst nsID&, void**)+00060 033E48B0 PPC 168828BC nsComponentManagerImpl::CreateInstance(const nsID&, nsISupports* , const nsID&, void**)+000A0 033E4860 PPC 15164CF8 nsWidgetFactory::CreateInstance(nsISupports*, const nsID&, void* *)+00CC4 033E4780 PPC 151862A4 nsAppShell::AddRef()+00064 033E4740 PPC 16866410 nsDebug::Assertion(const char*, const char*, const char*, int)+0 005C Closing log This makes debugging on mac pretty close to impossible.
It turns out we are accessing objects on threads other than the one on which they're defined all the time. Now I think this is ironic: only platforms for which NS_MT_DEFINED is not defined actually assert when this happens. I think every platform should be throwing thousands of asserts, but in the Big Three, only the Mac was. Patrick has just checked in a version of nsISupportsUtils.h that disables the assertions on !NS_MT_DEFINED machines.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Thanks for finding and fixing this Dan and Patrick. Sorry for missing it with my original checkin.
Adding verifyme keyword.
Keywords: verifyme
- Per last comments, age of bug, and no reopen - Marking Verified/Fixed. Please reopen if still a problem.
Status: RESOLVED → VERIFIED
OS: Mac System 9.x
You need to log in before you can comment on or make changes to this bug.