Closed Bug 183626 Opened 23 years ago Closed 10 years ago

###!!! ASSERTION: potential deadlock between CMonitor@15a5010 and Lock@15bce98:

Categories

(Core :: Networking, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: timeless, Assigned: timeless)

Details

(Keywords: assertion)

Attachments

(2 files, 1 obsolete file)

(cvs debug build w/ lots of debug flags set debug.mozconfig available -- from two weeks ago -- i am updating but rm is stuck...) *** Chrome Registration of package: Checking for contents.rdf at jar:resource:/chrome/messenger.jar!/content/messenger-region/ Parse Time (this=015A56C8): Real time 0:0:0.0, CP time 0.000 DTD Time: Real time 0:0:0.0, CP time 0.000 Tokenize Time: Real time 0:0:0.0, CP time 0.000 *** Chrome Registration of locale : Checking for contents.rdf at jar:resource:/chrome/en-US.jar!/locale/en-US/messenger/ ###!!! ASSERTION: potential deadlock between CMonitor@15a5010 and Lock@15bce98: 'Error', file i:/build/mozilla/xpcom/threads/nsAutoLock.cpp, line 265 Break: at file i:/build/mozilla/xpcom/threads/nsAutoLock.cpp, line 265 NTDLL! 77f9f9df() nsDebug::Assertion(const char * 0x0012cb9c, const char * 0x101323e0, const char * 0x10126560, int 265) line 280 + 13 bytes nsDebug::Error(const char * 0x0012cb9c, const char * 0x10126560, int 265) line 463 + 22 bytes nsAutoLockBase::nsAutoLockBase(void * 0x015bce98, nsAutoLockBase::nsAutoLockType eAutoLock) line 265 + 22 bytes nsAutoLock::nsAutoLock(PRLock * 0x015bce98) line 172 + 21 bytes nsJAR::GetInputStream(nsJAR * const 0x015b9fa0, const char * 0x015bcac0, nsIInputStream * * 0x015a5094) line 339 nsJARChannel::GetInputStream(nsJARChannel * const 0x015a5018, nsIInputStream * * 0x015a5094) line 680 + 46 bytes nsJARChannel::OpenJARElement() line 237 + 46 bytes nsJARChannel::EnsureJARFileAvailable() line 316 + 8 bytes nsJARChannel::Open(nsJARChannel * const 0x015a5010, nsIInputStream * * 0x0012de48) line 248 + 8 bytes RDFXMLDataSourceImpl::BlockingParse(nsIURI * 0x015b8d08, nsIStreamListener * 0x015c0ea0) line 550 + 36 bytes RDFXMLDataSourceImpl::Refresh(RDFXMLDataSourceImpl * const 0x015c0e94, int 1) line 896 + 55 bytes nsChromeRegistry::InstallProvider(const nsACString & {...}, const nsACString & {...}, int 0, int 1, int 0) line 2419 nsChromeRegistry::InstallLocale(nsChromeRegistry * const 0x01537010, const char * 0x01578bb0, int 0) line 2840 + 47 bytes nsChromeRegistry::ProcessNewChromeBuffer(char * 0x015956eb, int 8136) line 3571 + 41 bytes nsChromeRegistry::CheckForNewChrome(nsChromeRegistry * const 0x01537010) line 3434 + 16 bytes nsChromeRegistry::Init() line 379 nsChromeRegistryConstructor(nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012ec84) line 50 + 128 bytes nsGenericFactory::CreateInstance(nsGenericFactory * const 0x01535588, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012ec84) line 84 + 21 bytes nsComponentManagerImpl::CreateInstanceByContractID(nsComponentManagerImpl * const 0x0027d7a0, const char * 0x0213ab80, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012ec84) line 1878 + 24 bytes nsComponentManagerImpl::GetServiceByContractID(nsComponentManagerImpl * const 0x0027d7a4, const char * 0x0213ab80, const nsID & {...}, void * * 0x0012ece8) line 2277 + 50 bytes nsGetServiceByContractID::operator()(const nsID & {...}, void * * 0x0012ece8) line 121 + 38 bytes nsCOMPtr<nsIChromeRegistry>::assign_from_helper(const nsCOMPtr_helper & {...}, const nsID & {...}) line 922 + 18 bytes nsCOMPtr<nsIChromeRegistry>::nsCOMPtr<nsIChromeRegistry>(const nsCOMPtr_helper & {...}) line 554 nsChromeProtocolHandler::NewChannel(nsChromeProtocolHandler * const 0x01050380, nsIURI * 0x01050430, nsIChannel * * 0x0012f080) line 595 + 33 bytes nsIOService::NewChannelFromURI(nsIOService * const 0x01539fa0, nsIURI * 0x01050430, nsIChannel * * 0x0012f080) line 544 + 40 bytes NS_NewChannel(nsIChannel * * 0x0012f190, nsIURI * 0x01050430, nsIIOService * 0x01539fa0, nsILoadGroup * 0x0106a610, nsIInterfaceRequestor * 0x0108a328, unsigned int 524288) line 164 + 20 bytes nsDocShell::DoURILoad(nsIURI * 0x01050430, nsIURI * 0x00000000, nsISupports * 0x00000000, nsIInputStream * 0x00000000, nsIInputStream * 0x00000000, int 1, nsIDocShell * * 0x00000000, nsIRequest * * 0x00000000) line 5204 + 91 bytes nsDocShell::InternalLoad(nsDocShell * const 0x0108a300, nsIURI * 0x01050430, nsIURI * 0x00000000, nsISupports * 0x00000000, int 1, const unsigned short * 0x01535408, nsIInputStream * 0x00000000, nsIInputStream * 0x00000000, unsigned int 1, nsISHEntry * 0x00000000, int 1, nsIDocShell * * 0x00000000, nsIRequest * * 0x00000000) line 5122 + 51 bytes nsDocShell::LoadURI(nsDocShell * const 0x0108a300, nsIURI * 0x01050430, nsIDocShellLoadInfo * 0x01535338, unsigned int 0, int 1) line 730 + 73 bytes nsWindowWatcher::OpenWindowJS(nsWindowWatcher * const 0x0108a83c, nsIDOMWindow * 0x00000000, const char * 0x01074530, const char * 0x01dfd954, const char * 0x01dfd58c, int 1, unsigned int 1, long * 0x0106ec10, nsIDOMWindow * * 0x0012fa40) line 781 nsWindowWatcher::OpenWindow(nsWindowWatcher * const 0x0108a838, nsIDOMWindow * 0x00000000, const char * 0x01074530, const char * 0x01dfd954, const char * 0x01dfd58c, nsISupports * 0x01074600, nsIDOMWindow * * 0x0012fa40) line 459 + 48 bytes nsProfile::LoadDefaultProfileDir(nsCString & {...}, int 1) line 523 + 94 bytes nsProfile::StartupWithArgs(nsProfile * const 0x01082e08, nsICmdLineService * 0x01077bb0, int 1) line 355 + 16 bytes nsAppShellService::DoProfileStartup(nsAppShellService * const 0x01066f88, nsICmdLineService * 0x01077bb0, int 1) line 266 + 31 bytes InitializeProfileService(nsICmdLineService * 0x01077bb0) line 1175 + 31 bytes main1(int 1, char * * 0x002844d0, nsISupports * 0x00276f08) line 1454 + 14 bytes main(int 1, char * * 0x002844d0) line 1902 + 37 bytes mainCRTStartup() line 338 + 17 bytes KERNEL32! 77e87903() from the looks of it nsJARChannel::OpenJARElement() { nsresult rv; nsAutoCMonitor mon(this); rv = Open(); if (NS_SUCCEEDED(rv)) rv = GetInputStream(getter_AddRefs(mSynchronousInputStream)); nsJARChannel::GetInputStream(nsIInputStream* *aInputStream) { #ifdef PR_LOGGING if (PR_LOG_TEST(gJarProtocolLog, PR_LOG_DEBUG)) { nsCAutoString jarURLStr; mURI->GetSpec(jarURLStr); PR_LOG(gJarProtocolLog, PR_LOG_DEBUG, ("nsJarProtocol: GetInputStream jar entry %s", jarURLStr.get())); } #endif NS_ENSURE_TRUE(mJAR, NS_ERROR_NULL_POINTER); nsresult rv = mJAR->GetInputStream(mJAREntry.get(), aInputStream); nsJAR::GetInputStream(const char* aFilename, nsIInputStream** result) { // nsZipArchive and zlib are not thread safe // we need to use a lock to prevent bug #51267 nsAutoLock lock(mLock);
+ mStr 0x0104ab98 "chrome://communicator/content/profile/profileSelection.xul"
Ok, i asked WellOrdered for help, here are locals in nsAutoLock.cpp addr2 0x015bce98 if (vec1->ElementAt(i) == addr2) i 0 n 4 nsVoidArray::ElementAt returned 0x0156cd20 i 1 n 4 nsVoidArray::ElementAt returned 0x0027dfd8 i 2 n 4 nsVoidArray::ElementAt returned 0x01548a70 i 3 n 4 nsVoidArray::ElementAt returned 0x015bcac0 -- if (addri == addr1 || Reachable(table, addr1, addri)) { n 5 i 0 addr1 0x015a5010 addri 0x0027dfd8 n 5 i 1 addr1 0x015a5010 addri 0x01548a70 n 5 i 2 addr1 0x015a5010 addri 0x015ba9b8 -- So much for that, it turns out that Reachable has to return something interesting but first the endpoint: here are the locals at nsAutoLock.cpp:224 rv = PR_FALSE; addri 0x015ba9b8 + vec2 0x015b9300 addr1 0x015a5010 addr2 0x015bce98 + vec1p 0x0012cc20 + vec2p 0x0012cc1c n 5 i 2 + table 0x0027d898 + vec1 0x015927c0 rv 1 -- Reachable (outermost call) n 6 goal 0x015a5010 if (addr == goal || Reachable(table, goal, addr)) addr 0x0027dfd8 i 0 addr 0x01548a70 i 1 addr 0x015baa90 i 2 addr 0x0156cd20 i 3 addr 0x01577dc8 i 4 addr 0x015a5010 goal 0x015a5010 i 5 at this point it returns and things wind down... fwiw, Reachable (1 level nested) first time it reached addr 0x0156cd20 i 0 second time it reached addr 0x0156cd20 i 0 i hope that's useful...
+clean-report -> eng attention
Keywords: clean-report
ok. it's reproducable. i have no idea how long it's been around, i haven't run my personal builds w/o -P <foo> in a long long time. -- well, when i use a null profile provider i would, but then it doesn't matter... note that i can't possibly get the profile manager w/ the null provider so that patch isn't the problem. steps on my (again still possibly not current tree), run 'mozilla.exe' w/o params. I have 3 profiles (two, n7, spell) so i should and do trigger the profile manager, which is the file that causes this assert. If someone can provide steps for gleaning the info they need I can now work on them at my leisure.
I hope this mozilla/xpcom-relative patch works; it compiles cleanly. It'll tell us quite a bit if timeless can run a --enable-trace-malloc configured DEBUG build with it and reproduce the deadlock. /be
I hate heisenbugs. ok, so w/o enabling tracemalloc the patch doesn't compile: i:/build/mozilla/xpcom/threads/nsAutoLock.cpp(277) : error C2065: 'node' : undeclared identifier make: *** [nsAutoLock.obj] Error 2 enabling it and only building xpcom, i didn't get the assertion... something random has decided to make my day not useful. i'm going to let mozilla cvs update and rebuild the world now and we'll see, but this bug will probably lose my attention for a while *sorry*. could we get this patch working anyway and check it in so that the next person (who will probably be me, but might be me on some other platform) can have this information? oh and for reference, because i didn't explicitly say so anywhere else in this bug, none of the other threads had anything interesting in them.
Obvious fix. /be
Attachment #108528 - Attachment is obsolete: true
*** Chrome Registration of locale : Checking for contents.rdf at jar:resource:/chrome/pl-win.jar!/locale/pl-PL/communicator-platform/ *** Potential deadlock between CMonitor@2ccbd98 and Lock@2cc3bd8 Current stack: NS_GetStackTrace[xpcom +0xF] nsAutoLockBase::nsAutoLockBase[xpcom +0x4F] nsAutoLock::nsAutoLock[xpcom +0x15] nsJAR::GetInputStream[jar50 +0x19] nsJARChannel::GetInputStream[necko +0xCD] nsJARChannel::OpenJARElement[necko +0x64] nsJARChannel::EnsureJARFileAvailable[necko +0x19E] nsJARChannel::Open[necko +0x28] RDFXMLDataSourceImpl::BlockingParse[rdf +0xBB] RDFXMLDataSourceImpl::Refresh[rdf +0x1E3] nsChromeRegistry::InstallProvider[chrome +0x1B8] nsChromeRegistry::InstallLocale[chrome +0x35] nsChromeRegistry::ProcessNewChromeBuffer[chrome +0x749] nsChromeRegistry::CheckForNewChrome[chrome +0x3DA] nsChromeRegistry::Init[chrome +0x7DF] NSGetModule[chrome +0xFFFFFF80] nsGenericFactory::CreateInstance[xpcom +0x2D] nsComponentManagerImpl::CreateInstanceByContractID[xpcom +0x70] nsComponentManagerImpl::GetServiceByContractID[xpcom +0x10C] nsGetServiceByContractID::operator()[xpcom +0xAF] nsCOMPtr<nsIXULChromeRegistry>::assign_from_helper[profile +0x1B] nsCOMPtr<nsIXULChromeRegistry>::nsCOMPtr<nsIXULChromeRegistry>[profile +0x22] nsProfile::DefineLocaleDefaultsDir[profile +0xFF] nsProfile::SetCurrentProfile[profile +0x755] nsProfile::ProcessArgs[profile +0x3C3] nsProfile::StartupWithArgs[profile +0x54] nsAppShellService::DoProfileStartup[appshell +0x99] do_GetService[mozilla +0x16DE] main[mozilla +0xC70] main[mozilla +0x1B8] mainCRTStartup[mozilla +0xFF] SetUnhandledExceptionFilter[KERNEL32 +0x5C] Previous stack: NS_GetStackTrace[xpcom +0xF] nsAutoLockBase::nsAutoLockBase[xpcom +0x4F] nsAutoLock::nsAutoLock[xpcom +0x15] nsJAR::GetInputStream[jar50 +0x19] nsJARChannel::GetInputStream[necko +0xCD] nsJARChannel::OpenJARElement[necko +0x64] nsJARChannel::EnsureJARFileAvailable[necko +0x19E] nsJARChannel::Open[necko +0x28] RDFXMLDataSourceImpl::BlockingParse[rdf +0xBB] RDFXMLDataSourceImpl::Refresh[rdf +0x1E3] nsChromeRegistry::InstallProvider[chrome +0x1B8] nsChromeRegistry::InstallLocale[chrome +0x35] nsChromeRegistry::ProcessNewChromeBuffer[chrome +0x749] nsChromeRegistry::CheckForNewChrome[chrome +0x3DA] nsChromeRegistry::Init[chrome +0x7DF] NSGetModule[chrome +0xFFFFFF80] nsGenericFactory::CreateInstance[xpcom +0x2D] nsComponentManagerImpl::CreateInstanceByContractID[xpcom +0x70] nsComponentManagerImpl::GetServiceByContractID[xpcom +0x10C] nsGetServiceByContractID::operator()[xpcom +0xAF] nsCOMPtr<nsIXULChromeRegistry>::assign_from_helper[profile +0x1B] nsCOMPtr<nsIXULChromeRegistry>::nsCOMPtr<nsIXULChromeRegistry>[profile +0x22] nsProfile::DefineLocaleDefaultsDir[profile +0xFF] nsProfile::SetCurrentProfile[profile +0x755] nsProfile::ProcessArgs[profile +0x3C3] nsProfile::StartupWithArgs[profile +0x54] nsAppShellService::DoProfileStartup[appshell +0x99] do_GetService[mozilla +0x16DE] main[mozilla +0xC70] main[mozilla +0x1B8] mainCRTStartup[mozilla +0xFF] SetUnhandledExceptionFilter[KERNEL32 +0x5C] ###!!! ASSERTION: Potential deadlock between CMonitor@2ccbd98 and Lock@2cc3bd8: 'Error', file i:/build/mozilla/xpcom/threads/nsAutoLock.cpp, line 295 Break: at file i:/build/mozilla/xpcom/threads/nsAutoLock.cpp, line 295
Attached file latest stack —
i think i cvs updated around tuesday. my rebuild was yesterday. i expect this stuff to break horribly the next time i update because tracemalloc was moved. can someone please explain what the concern is? ncompare says that the stacks are identical.
over to timeless. maybe you can hook up with brendan regarding these assertions?
Assignee: dougt → timeless
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: