Closed Bug 118735 Opened 23 years ago Closed 23 years ago

mozilla crashes on startup if "bad" entry in Personal Toolbar

Categories

(SeaMonkey :: Bookmarks & History, defect)

x86
All
defect
Not set
blocker

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: daa, Assigned: mozilla)

Details

(Keywords: smoketest)

Attachments

(2 files)

mozilla crashes on startup - if "Personal Toolbar Folder" has enough entries to be wider that window size
Attachment #63958 - Attachment description: sample minimal bookmarks.hmtl → sample minimal bookmarks.html
change summary crash is if either the tinderbox or bugzilla entry in attached bookmark.html is there
Summary: mozilla crashes on startup if too many entries in Personal Toolbar → mozilla crashes on startup if "bad" entry in Personal Toolbar
What build ID? Yesterday morning's?
20020108xx tip local build crashed win32 too both crashed on clean start( autoimport NS4 profile)
OS: Linux → All
confirmed on 2002010810 win32 official build
Keywords: smoketest
confirmed on linux current tip optimized build
Hyatt was talking about this exact problem yesterday, he was either fixing this, or breaking it. Reassigning ;)
Assignee: ben → hyatt
Attached file Stacktrace
adding stacktrace from todays CVS Linux
If that's the stack, then it has nothing to do with the window size.
The stack indicates its due to a change in RDF's in-memory datasource which went in on Sunday. Patch below: Index: mozilla/rdf/base/src/nsInMemoryDataSource.cpp =================================================================== RCS file: /cvsroot/mozilla/rdf/base/src/nsInMemoryDataSource.cpp,v retrieving revision 1.62 diff -u -2 -r1.62 nsInMemoryDataSource.cpp --- mozilla/rdf/base/src/nsInMemoryDataSource.cpp 7 Jan 2002 11:18:53 -0000 1.62 +++ mozilla/rdf/base/src/nsInMemoryDataSource.cpp 8 Jan 2002 21:32:55 -0000 @@ -700,6 +700,4 @@ if (mAssertion && mAssertion->mHashEntry) { // its our magical HASH_ENTRY forward hash for assertions - mAssertion = nsnull; - nsresult rv = NS_NewISupportsArray(getter_AddRefs(mHashArcs)); if (NS_SUCCEEDED(rv)) { @@ -709,4 +707,5 @@ ArcEnumerator, mHashArcs.get()); } + mAssertion = nsnull; } }
However, even with the patch applied, Mozilla then appears to spin forever inside of the XUL template builder. Waterson, do you have a few minutes to look at this with me?
If I had to take a guess, I'd say from the sample bookmarks file attached to this bug that the Personal Toolbar folder doesn't have an "ID" assigned to it in the file, so that the bookmark's service is trying to change its URL, and we're getting into an infinite loop somewhere between bookmarks, RDF and the XUL template builder.
Happy New Year, sugar puff.
Assignee: hyatt → rjc
Hmmm... at second glance, this is now a bug in XBL... reassigning back to Hyatt. ;) <hehe> Just kidding!
the bookmarks file is a imported NS4.7 bookmarks file from starting mozilla with no profiles available mozillais now hanging up in the import - after the importing alert closes ^C ing mozilla leaves a bookmarks.html with no ID=S probably need new bug
DOH! Here we go. Reviews, please! Index: mozilla/rdf/base/src/nsInMemoryDataSource.cpp =================================================================== RCS file: /cvsroot/mozilla/rdf/base/src/nsInMemoryDataSource.cpp,v retrieving revision 1.62 diff -u -2 -r1.62 nsInMemoryDataSource.cpp --- mozilla/rdf/base/src/nsInMemoryDataSource.cpp 7 Jan 2002 11:18:53 -0000 1.62 +++ mozilla/rdf/base/src/nsInMemoryDataSource.cpp 8 Jan 2002 22:49:34 -0000 @@ -700,6 +700,4 @@ if (mAssertion && mAssertion->mHashEntry) { // its our magical HASH_ENTRY forward hash for assertions - mAssertion = nsnull; - nsresult rv = NS_NewISupportsArray(getter_AddRefs(mHashArcs)); if (NS_SUCCEEDED(rv)) { @@ -709,4 +707,5 @@ ArcEnumerator, mHashArcs.get()); } + mAssertion = nsnull; } } @@ -758,4 +757,5 @@ if (itemCount > 0) { nsCOMPtr<nsIRDFResource> res = do_QueryInterface(mHashArcs-> ElementAt(itemCount-1)); + mHashArcs->RemoveElementAt(itemCount-1); mCurrent = res; NS_IF_ADDREF(mCurrent);
Status: NEW → ASSIGNED
Keywords: crash
This first chunk looks fine. The second chunk leaks (always did, my bad for not catching it). nsISupportsArray::ElementAt() addref's. Why don't you do this instead: if (itemCount > 0) PRInt32 last = itemCount - 1; mCurrent = NS_STATIC_CAST(nsIRDFResource *, mHashArcs->ElementAt(last)); mHashArcs->RemoveElementAt(last); *aResult = PR_TRUE; return NS_OK; } Also saves an unneeded QI, since you _know_ the only things being put in this array are nsIRDFResource objeccts.
Keywords: crash
OK. Index: mozilla/rdf/base/src/nsInMemoryDataSource.cpp =================================================================== RCS file: /cvsroot/mozilla/rdf/base/src/nsInMemoryDataSource.cpp,v retrieving revision 1.62 diff -u -2 -r1.62 nsInMemoryDataSource.cpp --- mozilla/rdf/base/src/nsInMemoryDataSource.cpp 7 Jan 2002 11:18:53 -0000 1.62 +++ mozilla/rdf/base/src/nsInMemoryDataSource.cpp 8 Jan 2002 23:12:23 -0000 @@ -700,6 +700,4 @@ if (mAssertion && mAssertion->mHashEntry) { // its our magical HASH_ENTRY forward hash for assertions - mAssertion = nsnull; - nsresult rv = NS_NewISupportsArray(getter_AddRefs(mHashArcs)); if (NS_SUCCEEDED(rv)) { @@ -709,4 +707,5 @@ ArcEnumerator, mHashArcs.get()); } + mAssertion = nsnull; } } @@ -757,7 +756,8 @@ if (NS_FAILED(rv = mHashArcs->Count(&itemCount))) return(rv); if (itemCount > 0) { - nsCOMPtr<nsIRDFResource> res = do_QueryInterface(mHashArcs-> ElementAt(itemCount-1)); - mCurrent = res; - NS_IF_ADDREF(mCurrent); + --itemCount; + mCurrent = NS_STATIC_CAST(nsIRDFResource *, + mHashArcs->ElementAt(itemCount)); + mHashArcs->RemoveElementAt(itemCount); *aResult = PR_TRUE; return NS_OK;
sr=waterson
Fixed. Thanks for the reviews, Chris and Darin.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: