Closed Bug 419654 Opened 16 years ago Closed 16 years ago

Importing bookmark file corrupts heap (reproducible)

Categories

(Firefox :: Bookmarks & History, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Firefox 3 beta5

People

(Reporter: ondrej, Assigned: ondrej)

Details

(Keywords: valgrind)

Attachments

(3 files)

During tests of bookmark import performance I have encountered heap corruption. This seems to be reproducible, test case attached (please change the path if you want to test it). Michal, the nearest valgrind master, found the cause of the problem - appending an element to an array leads to array relocation what makes the reference taken earlier invalid. In this case we simply use the reference little earlier.

Additionally I have increased the initial capacity of mFrames to 16 to avoid relocations when new frames are added. This could be reasonable size for bookmark files.
Flags: blocking-firefox3?
Attachment #305784 - Flags: review?(dietrich)
Flags: blocking-firefox3? → blocking-firefox3+
Priority: -- → P2
Comment on attachment 305784 [details] [diff] [review]
Fix heap corruption and increase initial capacity

good find, thanks.

> 
> Additionally I have increased the initial capacity of mFrames to 16 to avoid
> relocations when new frames are added. This could be reasonable size for
> bookmark files.
> 

there's no telling. 16 could be reasonable for one class of users, and 1600 reasonable for another.
Attachment #305784 - Flags: review?(dietrich) → review+
I hope, that 16 levels deep folder nesting will be ok for 99% of users.
99.999%
Keywords: checkin-needed
Attachment #305784 - Flags: approval1.9b4?
Keywords: valgrind
Attachment #305784 - Flags: approval1.9b4? → approval1.9b4+
Checking in browser/components/places/src/nsPlacesImportExportService.cpp;
/cvsroot/mozilla/browser/components/places/src/nsPlacesImportExportService.cpp,v  <--  nsPlacesImportExportService.cpp
new revision: 1.49; previous revision: 1.48
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 beta4
Sorry, but I backed this out because it made centos go orange.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This doesn't block beta4, it was a patch taken for opportunity. We'll fix it after.
Target Milestone: Firefox 3 beta4 → Firefox 3
(In reply to comment #7)
> Sorry, but I backed this out because it made centos go orange.

According to tinderbox it was multiple timeout failure in widgets mochitest: 
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1204448460.1204452527.31977.gz

I have checked those tests and there is no relation to import/export of bookmarks. So it looks like coincidence. Can you please commit again?
Comment on attachment 305784 [details] [diff] [review]
Fix heap corruption and increase initial capacity

We'll do this after beta 4.
Attachment #305784 - Flags: approval1.9b4-
Attachment #305784 - Flags: approval1.9b4+
Attachment #305784 - Flags: approval1.9?
Comment on attachment 305784 [details] [diff] [review]
Fix heap corruption and increase initial capacity

This is a blocker. No approval1.9 needed.
Attachment #305784 - Flags: approval1.9?
Checking in browser/components/places/src/nsPlacesImportExportService.cpp;
/cvsroot/mozilla/browser/components/places/src/nsPlacesImportExportService.cpp,v  <--  nsPlacesImportExportService.cpp
new revision: 1.57; previous revision: 1.56
done
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: Firefox 3 → Firefox 3 beta5
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.

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

Attachment

General

Creator:
Created:
Updated:
Size: