Closed Bug 31904 Opened 25 years ago Closed 25 years ago

migrating imap profile causes assertions (chicken and egg problem)

Categories

(MailNews Core :: Backend, defect, P3)

x86
All
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sspitzer, Assigned: sspitzer)

Details

I think jefft's recent folder flag checkins is causing assertions on migration. to reproduce, migrate a 4.x profile that used imap. the assertion is line 96 of nsMsgAccount.cpp NS_ASSERTION(NS_SUCCEEDED(rv), "couldn't lazily create the server\n"); after that assertion, I get a few (3 or 4) mork assertions, which might be related. here's the stack trace to the assertion nsMsgAccount::GetIncomingServer(nsMsgAccount * const 0x0334ddf0, nsIMsgIncomingServer * * 0x0012c7c4) line 96 nsMsgAccountManager::LoadAccounts(nsMsgAccountManager * const 0x032cc810) line 957 + 59 bytes nsMsgAccountManager::GetAllServers(nsMsgAccountManager * const 0x032cc810, nsISupportsArray * * 0x0012c8a8) line 868 + 12 bytes nsMsgAccountManager::FindServer(nsMsgAccountManager * const 0x032cc810, const char * 0x03350e70, const char * 0x0012cbb4, const char * 0x03471b08, nsIMsgIncomingServer * * 0x0012cb98) line 1220 + 36 bytes nsImapURI2Path(const char * 0x03468f28 kImapRootURI, const char * 0x0334f630, nsFileSpec & {...}) line 110 + 84 bytes nsImapMailFolder::GetPath(nsImapMailFolder * const 0x0334f32c, nsIFileSpec * * 0x0012cd08) line 3388 + 27 bytes nsImapMailFolder::GetDBFolderInfoAndDB(nsImapMailFolder * const 0x0334f32c, nsIDBFolderInfo * * 0x0012cd48, nsIMsgDatabase * * 0x0012cd40) line 1271 + 42 bytes nsMsgFolder::OnFlagChange(nsMsgFolder * const 0x0334f32c, unsigned int 512) line 1444 + 63 bytes nsMsgFolder::SetFlag(nsMsgFolder * const 0x0334f32c, unsigned int 512) line 1404 nsMsgIdentity::setFolderPref(const char * 0x028baf3c, const char * 0x0334f6f0) line 529 + 30 bytes nsMsgIdentity::SetFccFolder(nsMsgIdentity * const 0x0334ece0, const char * 0x0334f6f0) line 473 + 20 bytes nsMessengerMigrator::SetMailCopiesAndFolders(nsIMsgIdentity * 0x0334ece0, const char * 0x0334dc00, const char * 0x0012d07c) line 836 + 223 bytes nsMessengerMigrator::MigrateImapAccount(nsIMsgIdentity * 0x0334cfd0, const char * 0x0012d10c, int 1) line 1557 + 40 bytes nsMessengerMigrator::MigrateImapAccounts(nsIMsgIdentity * 0x0334cfd0) line 1456 + 26 bytes nsMessengerMigrator::UpgradePrefs(nsMessengerMigrator * const 0x0334b600) line 647 + 17 bytes XPTC_InvokeByIndex(nsISupports * 0x0334b600, unsigned int 3, unsigned int 0, nsXPTCVariant * 0x0012d36c) line 139 nsXPCWrappedNativeClass::CallWrappedMethod(JSContext * 0x02e4fa90, nsXPCWrappedNative * 0x0334b2a0, const XPCNativeMemberDescriptor * 0x0334b3c4, nsXPCWrappedNativeClass::CallMode CALL_METHOD, unsigned int 0, long * 0x020fb084, long * 0x0012d52c) line 898 + 43 bytes WrappedNative_CallMethod(JSContext * 0x02e4fa90, JSObject * 0x021b7e98, unsigned int 0, long * 0x020fb084, long * 0x0012d52c) line 200 + 34 bytes js_Invoke(JSContext * 0x02e4fa90, unsigned int 0, unsigned int 0) line 665 + 26 bytes js_Interpret(JSContext * 0x02e4fa90, long * 0x0012de2c) line 2292 + 15 bytes js_Invoke(JSContext * 0x02e4fa90, unsigned int 0, unsigned int 0) line 681 + 13 bytes js_Interpret(JSContext * 0x02e4fa90, long * 0x0012e6e8) line 2292 + 15 bytes js_Invoke(JSContext * 0x02e4fa90, unsigned int 0, unsigned int 0) line 681 + 13 bytes js_Interpret(JSContext * 0x02e4fa90, long * 0x0012efa4) line 2292 + 15 bytes js_Invoke(JSContext * 0x02e4fa90, unsigned int 1, unsigned int 2) line 681 + 13 bytes js_InternalInvoke(JSContext * 0x02e4fa90, JSObject * 0x020c4558, long 15911672, unsigned int 0, unsigned int 1, long * 0x0012f130, long * 0x0012f0dc) line 754 + 19 bytes JS_CallFunctionValue(JSContext * 0x02e4fa90, JSObject * 0x020c4558, long 15911672, unsigned int 1, long * 0x0012f130, long * 0x0012f0dc) line 2790 + 31 bytes nsJSContext::CallEventHandler(nsJSContext * const 0x02e4e240, void * 0x020c4558, void * 0x00f2caf8, unsigned int 1, void * 0x0012f130, int * 0x0012f12c) line 562 + 33 bytes nsJSEventListener::HandleEvent(nsIDOMEvent * 0x032d8ee4) line 128 + 57 bytes nsEventListenerManager::HandleEventSubType(nsListenerStruct * 0x02ff3da0, nsIDOMEvent * 0x032d8ee4, unsigned int 1, unsigned int 7) line 698 + 19 bytes nsEventListenerManager::HandleEvent(nsIPresContext * 0x02e93650, nsEvent * 0x0012fbfc, nsIDOMEvent * * 0x0012f544, unsigned int 7, nsEventStatus * 0x0012fc3c) line 1249 + 35 bytes GlobalWindowImpl::HandleDOMEvent(GlobalWindowImpl * const 0x02e4fdd4, nsIPresContext * 0x02e93650, nsEvent * 0x0012fbfc, nsIDOMEvent * * 0x0012f544, unsigned int 1, nsEventStatus * 0x0012fc3c) line 374 nsWebShell::OnEndDocumentLoad(nsWebShell * const 0x02e21278, nsIDocumentLoader * 0x02e22470, nsIChannel * 0x02e90a80, unsigned int 0) line 2378 + 51 bytes nsDocLoaderImpl::FireOnEndDocumentLoad(nsDocLoaderImpl * 0x02e22470, nsIChannel * 0x02e90a80, unsigned int 0) line 603 nsDocLoaderImpl::DocLoaderIsEmpty(unsigned int 0) line 494 nsDocLoaderImpl::OnStopRequest(nsDocLoaderImpl * const 0x02e22474, nsIChannel * 0x032e4660, nsISupports * 0x00000000, unsigned int 0, const unsigned short * 0x00000000) line 438 nsLoadGroup::RemoveChannel(nsLoadGroup * const 0x02e22410, nsIChannel * 0x032e4660, nsISupports * 0x00000000, unsigned int 0, const unsigned short * 0x00000000) line 535 + 42 bytes nsFileChannel::OnStopRequest(nsFileChannel * const 0x032e4664, nsIChannel * 0x032e42a0, nsISupports * 0x00000000, unsigned int 0, const unsigned short * 0x00000000) line 455 nsOnStopRequestEvent::HandleEvent(nsOnStopRequestEvent * const 0x032e56e0) line 288 nsStreamListenerEvent::HandlePLEvent(PLEvent * 0x032e5690) line 97 + 12 bytes PL_HandleEvent(PLEvent * 0x032e5690) line 563 + 10 bytes PL_ProcessPendingEvents(PLEventQueue * 0x00ff1b90) line 508 + 9 bytes _md_EventReceiverProc(HWND__ * 0x030c0336, unsigned int 49374, unsigned int 0, long 16718736) line 1018 + 9 bytes USER32! 77e71820() 00ff1b90() and then I get mork asserts: NTDLL! 77f7629c() nsDebug::Assertion(const char * 0x0295cbb0, const char * 0x0295cabc, const char * 0x0295ca8c, int 78) line 189 + 13 bytes mork_assertion_signal(const char * 0x0295cbb0) line 78 + 31 bytes morkEnv::NewError(const char * 0x0392b280) line 369 + 19 bytes morkFile::NewFileErrnoError(morkEnv * 0x0393daa0) line 272 morkStdioFile::new_stdio_file_fault(morkEnv * 0x0393daa0) line 668 morkStdioFile::OpenStdio(morkEnv * 0x0393daa0, const char * 0x0393d510, const char * 0x0295cdf8) line 739 morkStdioFile::morkStdioFile(morkEnv * 0x0393daa0, const morkUsage & {...}, nsIMdbHeap * 0x022c5dc8, nsIMdbHeap * 0x022c5dc8, const char * 0x0393d510, const char * 0x0295cdf8) line 693 morkStdioFile::OpenOldStdioFile(morkEnv * 0x0393daa0, nsIMdbHeap * 0x022c5dc8, const char * 0x0393d510, unsigned char 0) line 371 + 62 bytes morkFile::OpenOldFile(morkEnv * 0x0393daa0, nsIMdbHeap * 0x022c5dc8, const char * 0x0393d510, unsigned char 0) line 178 + 21 bytes orkinFactory::OpenOldFile(nsIMdbEnv * 0x0393d5c8, nsIMdbHeap * 0x022c5dc8, const char * 0x0393d510, unsigned char 0, nsIMdbFile * * 0x0012f33c) line 312 + 21 bytes nsMsgDatabase::OpenMDB(nsMsgDatabase * const 0x0393db10, const char * 0x0393d968, int 0) line 752 + 34 bytes nsImapMailDatabase::Open(nsImapMailDatabase * const 0x0393fa40, nsIFileSpec * 0x0393dc00, int 0, int 0, nsIMsgDatabase * * 0x0012f528) line 93 + 29 bytes nsImapMailFolder::GetDBFolderInfoAndDB(nsImapMailFolder * const 0x0393fc1c, nsIDBFolderInfo * * 0x0012f66c, nsIMsgDatabase * * 0x0012f5b4) line 1274 + 49 bytes nsImapMailFolder::AddSubfolder(nsImapMailFolder * const 0x03351d5c, nsAutoString * 0x0012f898, nsIMsgFolder * * 0x0012f934) line 258 + 95 bytes nsImapMailFolder::CreateClientSubfolderInfo(nsImapMailFolder * const 0x03351dec, const char * 0x0012fbc0, unsigned short 47) line 658 + 62 bytes nsImapIncomingServer::PossibleImapMailbox(nsImapIncomingServer * const 0x0334d940, const char * 0x03938290, unsigned short 47, int 64) line 697 XPTC_InvokeByIndex(nsISupports * 0x0334d940, unsigned int 3, unsigned int 3, nsXPTCVariant * 0x0393c5e0) line 139 EventHandler(PLEvent * 0x0393c640) line 481 + 41 bytes PL_HandleEvent(PLEvent * 0x0393c640) line 563 + 10 bytes PL_ProcessPendingEvents(PLEventQueue * 0x00ff1b90) line 508 + 9 bytes _md_EventReceiverProc(HWND__ * 0x030c0336, unsigned int 49374, unsigned int 0, long 16718736) line 1018 + 9 bytes USER32! 77e71820() 00ff1b90()
I think I know how to fix this. I need to couple the server and the identity with the account before I set the fcc (and other values on the identity). testing a fix in nsMessengerMigrator.cpp
Assignee: jefft → sspitzer
I've already tortured Jeff about the Mork assertions - he's going to fix that problem. Not sure about the other one.
testing my fix now. so far, so good.
Status: NEW → ASSIGNED
Target Milestone: M15
I think I have a fix for the second case. I shouldn't do any work in nsMsgFolder::OnFlagChange(). It should simply return NS_OK. Sorry for all these troubles.
Seth, along with the fix I am about to check in. We don't need to do anything in nsMsgFolder::OnFlagChange(). Therefore, you don't need to do anything I think. I think I should take this bug.
actually, the change I am making is still worth making. but feel free to take this bug and mark it fixed if the assertions go away.
Reassign to me...
Assignee: sspitzer → jefft
Status: ASSIGNED → NEW
Seth, back to you. Since, you already have a fix and mine seems not well thought out.
Assignee: jefft → sspitzer
this assertion is now fixed. jefft, the mork assertions still exist. I'll open a new bug on that for you.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Verified FIXED. Using a debug windows 2000 build, the only assertion I got was in nsPrefMigration.cpp (failed to copy file).
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.