Bug 37527 - REGRESSION(r57511): many new graphics / svg related leaks
Summary: REGRESSION(r57511): many new graphics / svg related leaks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-13 15:44 PDT by Maciej Stachowiak
Modified: 2010-04-14 00:10 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.49 KB, patch)
2010-04-13 22:58 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2010-04-13 15:44:39 PDT
On the leak bot, r57511 seems to have caused many new leaks to appear in SVG and graphics code. See the DumpRenderTreeLeaks files here:

http://build.webkit.org/results/SnowLeopard%20Intel%20Leaks/r57511%20%285915%29/

The previous revision had much fewer leaks:

http://build.webkit.org/results/SnowLeopard%20Intel%20Leaks/r57510%20%285914%29/

Here is what the first leak looks like, there are many like this:

Process 16237: 598637 nodes malloced for 99435 KB
Process 16237: 502 leaks for 110384 total leaked bytes.
Leak: 0x13e5af000  size=11264  zone: DefaultMallocZone_0x1051ed000	
	0x00000000 0x00000000 0x00000000 0x00000000 	................
	0x00000000 0x00000000 0x00000000 0x00000000 	................
	0x00000000 0x00000000 0x00000000 0x00000000 	................
	0x00000000 0x00000000 0x00000000 0x00000000 	................
	0x00000000 0x00000000 0x00000000 0x00000000 	................
	0x00000000 0x00000000 0x00000000 0x00000000 	................
	0x00000000 0x00000000 0x00000000 0x00000000 	................
	0x00000000 0x00000000 0x00000000 0x00000000 	................
	...
	Call stack: [thread 0x7fff71041be0]: | start | main | dumpRenderTree(int, char const**) | runTestingServerLoop() | runTest(std::string const&) | -[NSRunLoop(NSRunLoop) runMode:beforeDate:] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSources0 | MultiplexerSource::perform() | URLConnectionClient::processEvents() | URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) | URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) | URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) | _NSURLConnectionDidFinishLoading | -[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:] | WebCore::ResourceLoader::didFinishLoading(WebCore::ResourceHandle*) | WebCore::MainResourceLoader::didFinishLoading() | WebCore::FrameLoader::finishedLoading() | WebCore::FrameLoader::checkLoadComplete() | WebCore::FrameLoader::recursiveCheckLoadComplete() | WebCore::FrameLoader::checkLoadCompleteForThisFrame() | WebFrameLoaderClient::dispatchDidFinishLoad() | CallFrameLoadDelegate(objc_object* (*)(objc_object*, objc_selector*, ...), WebView*, objc_selector*, objc_object*) | CallDelegate(objc_object* (*)(objc_object*, objc_selector*, ...), WebView*, objc_object*, objc_selector*, objc_object*) | -[FrameLoadDelegate webView:didFinishLoadForFrame:] | -[NSView displayIfNeeded] | -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] | -[NSNextStepFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] | -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[WebHTMLView(WebPrivate) _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[NSView _drawRect:clip:] | -[WebHTMLView drawRect:] | -[WebHTMLView drawSingleRect:] | -[WebFrame(WebInternal) _drawRect:contentsOnly:] | WebCore::FrameView::paintContents(WebCore::GraphicsContext*, WebCore::IntRect const&) | WebCore::RenderLayer::paint(WebCore::GraphicsContext*, WebCore::IntRect const&, unsigned int, WebCore::RenderObject*) | WebCore::RenderLayer::paintLayer(WebCore::RenderLayer*, WebCore::GraphicsContext*, WebCore::IntRect const&, unsigned int, WebCore::RenderObject*, WTF::HashMap<WebCore::OverlapTestRequestClient*, WebCore::IntRect, WTF::PtrHash<WebCore::OverlapTestRequestClient*>, WTF::HashTraits<WebCore::OverlapTestRequestClient*>, WTF::HashTraits<WebCore::IntRect> >*, unsigned int) | WebCore::RenderLayer::paintLayer(WebCore::RenderLayer*, WebCore::GraphicsContext*, WebCore::IntRect const&, unsigned int, WebCore::RenderObject*, WTF::HashMap<WebCore::OverlapTestRequestClient*, WebCore::IntRect, WTF::PtrHash<WebCore::OverlapTestRequestClient*>, WTF::HashTraits<WebCore::OverlapTestRequestClient*>, WTF::HashTraits<WebCore::IntRect> >*, unsigned int) | WebCore::RenderSVGRoot::paint(WebCore::RenderObject::PaintInfo&, int, int) | WebCore::RenderBox::paint(WebCore::RenderObject::PaintInfo&, int, int) | WebCore::RenderSVGContainer::paint(WebCore::RenderObject::PaintInfo&, int, int) | WebCore::RenderSVGContainer::paint(WebCore::RenderObject::PaintInfo&, int, int) | WebCore::RenderPath::paint(WebCore::RenderObject::PaintInfo&, int, int) | WebCore::SVGRenderBase::prepareToRenderSVGContent(WebCore::RenderObject*, WebCore::RenderObject::PaintInfo&, WebCore::FloatRect const&, WebCore::SVGResourceFilter*&, WebCore::SVGResourceFilter*) | WebCore::RenderSVGResourceClipper::applyResource(WebCore::RenderObject*, WebCore::GraphicsContext*) | WebCore::RenderSVGResourceClipper::applyClippingToContext(WebCore::RenderObject*, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::GraphicsContext*) | WebCore::GraphicsContext::clipToImageBuffer(WebCore::FloatRect const&, WebCore::ImageBuffer const*) | WebCore::ImageBuffer::image() const | CGBitmapContextCreateImage | CGDataProviderCreateWithCopyOfData | malloc | malloc_zone_malloc 
Leak: 0x113206400  size=2048  zone: DefaultMallocZone_0x1051ed000	string ''
Comment 1 Maciej Stachowiak 2010-04-13 15:49:05 PDT
http://trac.webkit.org/changeset/57511
Comment 2 Shinichiro Hamaji 2010-04-13 16:00:14 PDT
It looks like we need to call delete values of m_clipper in ~RenderSVGResourceClipper(). Maybe we should call deleteAllValues(m_clipper) or invalidateClients().
Comment 3 Dirk Schulze 2010-04-13 22:58:13 PDT
Created attachment 53320 [details]
Patch
Comment 4 Eric Seidel (no email) 2010-04-13 23:06:19 PDT
Comment on attachment 53320 [details]
Patch

Looks reasonable.
Comment 5 Dirk Schulze 2010-04-13 23:13:13 PDT
Comment on attachment 53320 [details]
Patch

Clearing flags on attachment: 53320

Committed r57564: <http://trac.webkit.org/changeset/57564>
Comment 6 Dirk Schulze 2010-04-13 23:13:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Nikolas Zimmermann 2010-04-14 00:10:15 PDT
Oops, /me hides in a dark corner.
I could have sworn it said "delete m_clipper.take(..)" .... and the dtor, I just missed it. In fact it was in an earlier patch, that wasn't uploaded. Sorry for the trouble, glad that we have a leak bot!