Bug 88470

Summary: MHTMLArchives are leaked when a MHTML file is loaded
Product: WebKit Reporter: Jay Civelli <jcivelli>
Component: WebCore Misc.Assignee: Jay Civelli <jcivelli>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, japhet, jochen, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing
none
Patch for landing none

Jay Civelli
Reported 2012-06-06 16:51:22 PDT
When we load a MHTML document, the MHTMLArchives and resources are leaked. This is caused by circular references of the MHTMLArchives, which are ref counted. The problem comes from the fact that MHTML is a flat format that lists frames and resources, when the WebKit Archive class has a tree structure. In order to have any frame have access to any resources, we add all archives and resources to all other archives. That causes the circular references, preventing the archives from going away.
Attachments
Patch (5.34 KB, patch)
2012-06-06 16:55 PDT, Jay Civelli
no flags
Patch (5.35 KB, patch)
2012-06-07 17:07 PDT, Jay Civelli
no flags
Patch for landing (5.35 KB, patch)
2012-06-07 17:47 PDT, Jay Civelli
no flags
Patch for landing (5.35 KB, patch)
2012-06-25 11:20 PDT, Jay Civelli
no flags
Jay Civelli
Comment 1 2012-06-06 16:55:57 PDT
Adam Barth
Comment 2 2012-06-07 15:22:52 PDT
Comment on attachment 146147 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=146147&action=review > Source/WebCore/loader/archive/Archive.cpp:46 > + for (Vector<RefPtr<Archive> >::iterator it = m_subframeArchives.begin(); it != m_subframeArchives.end(); ++it) This loop should have { } around its body.
Jay Civelli
Comment 3 2012-06-07 17:07:38 PDT
Jay Civelli
Comment 4 2012-06-07 17:47:01 PDT
Created attachment 146432 [details] Patch for landing
WebKit Review Bot
Comment 5 2012-06-07 19:21:11 PDT
Comment on attachment 146432 [details] Patch for landing Rejecting attachment 146432 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1 ERROR: /mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: http://queues.webkit.org/results/12909471
Jay Civelli
Comment 6 2012-06-08 09:37:32 PDT
Adam, Could you R+ CQ+? I tried to land but somehow the reviewer in the log did not get set, sorry. Thanks!
Jay Civelli
Comment 7 2012-06-25 11:20:21 PDT
Created attachment 149330 [details] Patch for landing
WebKit Review Bot
Comment 8 2012-06-25 16:03:46 PDT
Comment on attachment 149330 [details] Patch for landing Clearing flags on attachment: 149330 Committed r121191: <http://trac.webkit.org/changeset/121191>
WebKit Review Bot
Comment 9 2012-06-25 16:04:09 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.