Bug 71259 - Leaks seen in RenderRegion::setRenderBoxRegionInfo on Leaks bot
Summary: Leaks seen in RenderRegion::setRenderBoxRegionInfo on Leaks bot
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Mihnea Ovidenie
URL: http://build.webkit.org/LeaksViewer/?...
Keywords: InRadar, MakingBotsRed
Depends on:
Blocks: 57312
  Show dependency treegraph
Reported: 2011-10-31 17:57 PDT by Adam Roben (:aroben)
Modified: 2011-11-07 13:15 PST (History)
7 users (show)

See Also:

Patch (2.39 KB, patch)
2011-11-07 04:51 PST, Mihnea Ovidenie
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2011-10-31 17:57:23 PDT

malloc_zone_malloc > malloc > fastMalloc > RenderRegion::setRenderBoxRegionInfo

We're leaking in this function. Looks like we're allocating a new RenderBoxRegionInfo, storing it in a HashMap, and never deleting it.
Comment 1 Radar WebKit Bug Importer 2011-10-31 17:57:35 PDT
Comment 2 Darin Adler 2011-11-05 18:20:43 PDT
*** Bug 71260 has been marked as a duplicate of this bug. ***
Comment 3 Mihnea Ovidenie 2011-11-06 01:44:14 PST
I have taken a look at both methods RenderRegion::setRenderBoxRegionInfo and RenderFlowThread::setRegionRangeForBox. Using our current tests, i was not able to find a place where we leak in these functions and their associated data.

What i have found is that  in JavaScriptCore/Parser.cpp, Parser class destructor, we are not freeing the Lexer object that was allocated in the Parser ctor. I will make a patch with that fix unless there is a reason for doing that after https://bugs.webkit.org/show_bug.cgi?id=71138.
Comment 4 Mihnea Ovidenie 2011-11-06 10:29:46 PST
Leaks are reported if one loads fast/regions/overflow-in-uniform-regions-dynamic.html.
Comment 5 Mihnea Ovidenie 2011-11-06 12:23:40 PST
In RenderFlowThread::logicalWidthChangedInRegions, oldInfo is deleted only inside the condition:
if (!newInfo || newInfo->logicalWidth() != oldInfo->logicalWidth()) {

Otherwise, it is left undeleted and leaked.
Comment 6 Mihnea Ovidenie 2011-11-06 12:34:23 PST
The other leak is in function RenderRegion::removeRenderBoxRegionInfo, when the RenderBoxRegionInfo is removed from the map but not deleted.
Comment 7 Mihnea Ovidenie 2011-11-06 12:41:59 PST
I can make a patch for this one and another for 71260 if this is ok with you.
Comment 8 Darin Adler 2011-11-06 14:28:43 PST
Sure, if you want to handle this, that’s fine.
Comment 9 Mihnea Ovidenie 2011-11-07 04:51:08 PST
Created attachment 113846 [details]
Comment 10 WebKit Review Bot 2011-11-07 13:15:09 PST
Comment on attachment 113846 [details]

Clearing flags on attachment: 113846

Committed r99467: <http://trac.webkit.org/changeset/99467>
Comment 11 WebKit Review Bot 2011-11-07 13:15:14 PST
All reviewed patches have been landed.  Closing bug.