crash on startup when doing forced db migration




Bookmarks & History
11 years ago
9 years ago


(Reporter: (not reading, please use instead), Assigned: (not reading, please use instead))



Firefox Tracking Flags

(Not tracked)



(1 attachment)

crash on startup when doing forced db migration.

the problem is with code in nsNavHistory::ForceMigrateBookmarksDB() that will fail if we can't drop the moz_bookmarks_folders table.

this could fail if the table doesn't exist.  (and it doesn't exist anymore, now that bug #379986 has landed).

when ForceMigrateBookmarksDB() fails, the nsNavHistory::Init() will fail, and the later we'll crash in nsPlacesImportExportService::nsPlacesImportExportService().

I think we should do a DROP TABLE IF EXISTS instead of DROP TABLE for the tables we attempt to migrate.
for the stack to the crash:

>	brwsrcmp.dll!nsPlacesImportExportService::nsPlacesImportExportService()  Line 300 + 0x1c bytes	C++
 	brwsrcmp.dll!nsPlacesImportExportServiceConstructor(nsISupports * aOuter=0x00000000, const nsID & aIID={...}, void * * aResult=0x0012eb4c)  Line 87 + 0x3f bytes	C++
 	brwsrcmp.dll!nsGenericFactory::CreateInstance(nsISupports * aOuter=0x00000000, const nsID & aIID={...}, void * * aResult=0x0012eb4c)  Line 80 + 0x17 bytes	C++
 	xpcom_core.dll!nsComponentManagerImpl::CreateInstance(const nsID & aClass={...}, nsISupports * aDelegate=0x00000000, const nsID & aIID={...}, void * * aResult=0x0012eb4c)  Line 1714 + 0x1a bytes	C++
 	xpcom_core.dll!nsComponentManagerImpl::GetService(const nsID & aClass={...}, const nsID & aIID={...}, void * * result=0x0012ec00)  Line 1926 + 0x34 bytes	C++
 	xpc3250.dll!nsJSCID::GetService(nsISupports * * _retval=0x0012ed94)  Line 899 + 0x4a bytes	C++
 	xpcom_core.dll!NS_InvokeByIndex_P(nsISupports * that=0x0000000b, unsigned int methodIndex=1, unsigned int paramCount=1240468, nsXPTCVariant * params=0x03b5ece0)  Line 102	C++
 	xpc3250.dll!XPCWrappedNative::CallMethod(XPCCallContext & ccx={...}, XPCWrappedNative::CallMode mode=11)  Line 2245 + 0x1e bytes	C++
 	xpc3250.dll!XPCWrappedNative::CallMethod(XPCCallContext & ccx={...}, XPCWrappedNative::CallMode mode=CALL_METHOD)  Line 2245 + 0x1e bytes	C++
 	xpc3250.dll!XPC_WN_CallMethod(JSContext * cx=0x03d99f28, JSObject * obj=0x00e05cc0, unsigned int argc=1, long * argv=0x03dec73c, long * vp=0x0012f03c)  Line 1467 + 0xe bytes	C++
 	js3250.dll!js_Invoke(JSContext * cx=0x03d99f28, unsigned int argc=1, unsigned int flags=0)  Line 1332 + 0x20 bytes	C
 	js3250.dll!js_Interpret(JSContext * cx=0x03d99f28, unsigned char * pc=0x03c4f648, long * result=0x0012f6f4)  Line 4025 + 0xf bytes	C
 	js3250.dll!js_Invoke(JSContext * cx=0x03d99f28, unsigned int argc=3, unsigned int flags=2)  Line 1351 + 0x13 bytes	C
 	xpc3250.dll!nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS * wrapper=0x03d1ebd8, unsigned short methodIndex=3, const XPTMethodDescriptor * info=0x00cd9710, nsXPTCMiniVariant * nativeParams=0x0012fa5c)  Line 1419 + 0x14 bytes	C++
 	xpc3250.dll!nsXPCWrappedJS::CallMethod(unsigned short methodIndex=3, const XPTMethodDescriptor * info=0x00cd9710, nsXPTCMiniVariant * params=0x0012fa5c)  Line 566	C++
 	xpcom_core.dll!PrepareAndDispatch(nsXPTCStubBase * self=0x03d1ec38, unsigned int methodIndex=3, unsigned int * args=0x0012fb1c, unsigned int * stackBytesToPop=0x0012fb0c)  Line 114 + 0x21 bytes	C++
 	xpcom_core.dll!SharedStub()  Line 142	C++
 	xpcom_core.dll!nsObserverList::NotifyObservers(nsISupports * aSubject=0x03d1ec38, const char * aTopic=0x00000000, const unsigned short * someData=0x100346c0)  Line 129	C++
 	xpcom_core.dll!nsObserverList::NotifyObservers(nsISupports * aSubject=0x00000000, const char * aTopic=0x100346c0, const unsigned short * someData=0x00000000)  Line 129	C++
 	xpcom_core.dll!nsObserverService::NotifyObservers(nsISupports * aSubject=0x00000000, const char * aTopic=0x100346c0, const unsigned short * someData=0x00000000)  Line 184	C++
 	xul.dll!XRE_main(int argc=1, char * * argv=0x00b99150, const nsXREAppData * aAppData=0x004036b4)  Line 2790	C++
 	firefox.exe!main(int argc=1, char * * argv=0x00b99150)  Line 61 + 0x13 bytes	C++
 	firefox.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes	C
 	firefox.exe!mainCRTStartup()  Line 403	C
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
Assignee: nobody → sspitzer
from irc, some feedback from Asaf:

<sspitzerMsgMe> i think we want to switch to DROP TABLE IF EXISTS for all the tables we drop
<Mano> i guess that would be right, though i would like migration code to be a bit more explicit. 
<Mano> i.e. call drop only if migrating before schema version X
Blocks: 370099
Created attachment 265094 [details] [diff] [review]

for what mano asked for in irc, I suggest a spin off bug.
Attachment #265094 - Flags: review?(dietrich)
Comment on attachment 265094 [details] [diff] [review]

r=me, we can optimize migration in the follow-up.
Attachment #265094 - Flags: review?(dietrich) → review+

Checking in nsNavHistory.cpp;
/cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.cpp,v  <--  nsNavHis
new revision: 1.124; previous revision: 1.123
Last Resolved: 11 years ago
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.