Closed Bug 69932 Opened 23 years ago Closed 23 years ago

Crash when filing root bookmark folder into root bookmark folder itself.

Categories

(SeaMonkey :: Bookmarks & History, defect, P1)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9

People

(Reporter: doctor__j, Assigned: paulkchen)

Details

(Keywords: crash)

Attachments

(3 files)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; 0.8) Gecko/20010222
BuildID:    2001022209

Reproducible: Always
Steps to Reproduce:
1) Open bookmark window
2) Select "Bookmarks for <somebody>" (i.e. the root folder)
3) Click "File Bookmark" button on the toolbar
4) Choose "File in "Bookmarks for <somebody>" "
5) Kernel usage surges to 100% and causing stack fault a moment later
   (MOZILLA caused a stack fault in module XPCOM.DLL)


Actual Results:  Kernel usage tops 100% and then stack fault occurred

Expected Results:  There should be a checking to forbid this action.

In Windows terminology, it's just like cutting a folder from a location and
pasting it into the same location.  Windows will report an error: "Cannot move
<dir>: The destination folder is the same as the source folder."
confirming with 2001022108 builds. On my mac it hung for a while and then crashed in the
'BowelsOfTheMemoryMgr'.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: nsbeta1
OS: Windows 98 → All
Hardware: PC → All
Keywords: crash
Serious. 0.9. 
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla0.9
nav triage team:

Marking nsbeta1+, reassigning to pchen to investigate
Assignee: ben → pchen
Status: ASSIGNED → NEW
Keywords: nsbeta1nsbeta1+
Ok, just posted the fix.

1) Added <stringbundle> tag into xul for easy reference from js code.

2) Added some strings to bookmark.properties string bundle

3) In the js code for file bookmark, while we loop over the selection, check to 
see if a) the current item is the root bookmark, b) the current item is the same 
as destination folder, and c) the container of the current item is the same as 
destination folder. Also, fixed a bug in that the for loop is the wrong construct 
to loop over the selection. The problem is that 
bookmarksTree.selectedItems.length is a dynamic value that decrements by one 
every time throught he for loop because you're moving stuff. So basically, I 
think we only moved at most half the selected bookmarks. Changed the for loop to 
a while loop.
So, the main reason for this fix will become irrelevant when Ben supposedly
removes the root bookmark folder. If this doesn't happen for 0.9, then I suggest
my patch go in for 0.9. No need to have unecessary crashes
Is the root folder really being removed?  Wasn't it just added recently as part 
of another bug?

In the patches here, we need to use nsIStringBundle's FormatStringFromName
(stringKey, [array-of-string-vars], arrayLength) method instead of 
concatenating them like this (the stringbundle binding contains a simplified 
formatStringFromName method that doesn't make you specify the array length).
So the root bookmark folder doesn't exist anymore (using 2001041804 win32
build), and when Ben moves bookmarks to the outliner, the code to get the
bookmark name for the dialog will break also. Marking this bug fixed.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
VERIFIED Fixed with 2001042608 builds on all platforms (b/c the root folder is gone)
Status: RESOLVED → VERIFIED
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: