Bug 88255 - [GTK] Fix two more memory leaks in DRT
Summary: [GTK] Fix two more memory leaks in DRT
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sudarsana Nagineni (babu)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-04 14:18 PDT by Sudarsana Nagineni (babu)
Modified: 2012-06-05 09:19 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.10 KB, patch)
2012-06-05 07:43 PDT, Sudarsana Nagineni (babu)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sudarsana Nagineni (babu) 2012-06-04 14:18:49 PDT
cairo surface is leaking here http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp#L51

==12917== 1,920,640 (368 direct, 1,920,272 indirect) bytes in 1 blocks are definitely lost in loss record 9,776 of 9,776
==12917==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12917==    by 0xC65BB1F: _cairo_image_surface_create_for_pixman_image (cairo-image-surface.c:158)
==12917==    by 0xC65E448: _cairo_image_surface_create_with_pixman_format (cairo-image-surface.c:335)
==12917==    by 0x4684EF: createBitmapContextFromWebView(bool, bool, bool, bool) (PixelDumpSupportGtk.cpp:54)
==12917==    by 0x4575A9: dumpWebViewAsPixelsAndCompareWithExpected(std::string const&) (PixelDumpSupport.cpp:56)
==12917==    by 0x45E6EF: dump() (DumpRenderTree.cpp:583)
==12917==    by 0x45FB31: topLoadingFrameLoadFinished() (DumpRenderTree.cpp:1031)
==12917==    by 0x45FC6E: webFrameLoadStatusNotified(_WebKitWebFrame*, void*) (DumpRenderTree.cpp:1061)
==12917==    by 0xC0FECA1: g_closure_invoke (gclosure.c:777)
==12917==    by 0xC10FD70: signal_emit_unlocked_R (gsignal.c:3547)
==12917==    by 0xC118098: g_signal_emit_valist (gsignal.c:3296)
==12917==    by 0xC118241: g_signal_emit (gsignal.c:3352)
==12917==    by 0xC103956: g_object_dispatch_properties_changed (gobject.c:1041)
==12917==    by 0xC105232: g_object_notify (gobject.c:1133)
==12917==    by 0x6C919C1: WebKit::notifyStatus(_WebKitWebFrame*, WebKitLoadStatus) (FrameLoaderClientGtk.cpp:130)
==12917==    by 0x6C91A59: WebKit::loadDone(_WebKitWebFrame*, bool) (FrameLoaderClientGtk.cpp:143)
==12917==    by 0x6C93EBE: WebKit::FrameLoaderClient::dispatchDidFinishLoad() (FrameLoaderClientGtk.cpp:621)
==12917==    by 0x7450A35: WebCore::FrameLoader::checkLoadCompleteForThisFrame() (FrameLoader.cpp:2112)
==12917==    by 0x7451647: WebCore::FrameLoader::checkLoadComplete() (FrameLoader.cpp:2290)
==12917==    by 0x7449FF0: WebCore::FrameLoader::checkCompleted() (FrameLoader.cpp:713)
==12917==    by 0x7449D8B: WebCore::FrameLoader::loadDone() (FrameLoader.cpp:653)
==12917==    by 0x7429A92: WebCore::CachedResourceLoader::loadDone() (CachedResourceLoader.cpp:663)
==12917==    by 0x749AAA9: WebCore::SubresourceLoader::releaseResources() (SubresourceLoader.cpp:317)
==12917==    by 0x74904E1: WebCore::ResourceLoader::didFinishLoading(double) (ResourceLoader.cpp:298)
==12917==    by 0x749A696: WebCore::SubresourceLoader::didFinishLoading(double) (SubresourceLoader.cpp:278)
==12917==    by 0x7490C56: WebCore::ResourceLoader::didFinishLoading(WebCore::ResourceHandle*, double) (ResourceLoader.cpp:435)
==12917==    by 0x7633F1B: WebCore::readCallback(_GObject*, _GAsyncResult*, void*) (ResourceHandleSoup.cpp:864)
==12917==    by 0xBDFA918: async_ready_callback_wrapper (ginputstream.c:470)
==12917==    by 0xBE0CF56: g_simple_async_result_complete (gsimpleasyncresult.c:767)
==12917==    by 0xBE0CFD7: complete_in_idle_cb_for_thread (gsimpleasyncresult.c:835)
==12917==    by 0xC385C99: g_main_context_dispatch (gmain.c:2515)
==12917==    by 0xC38605F: g_main_context_iterate.isra.23 (gmain.c:3123)
==12917==    by 0xC386459: g_main_loop_run (gmain.c:3317)
==12917==    by 0xB18725C: gtk_main (gtkmain.c:1165)
==12917==    by 0x45EC6E: runTest(std::string const&) (DumpRenderTree.cpp:704)
==12917==    by 0x46133A: main (DumpRenderTree.cpp:1390)
Comment 1 Sudarsana Nagineni (babu) 2012-06-04 14:52:06 PDT
I found an another leak in DRT dumpHistoryItem() while fixing the one in bug description.

==12884== 2 bytes in 2 blocks are definitely lost in loss record 22 of 12,928
==12884==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12884==    by 0xC3B2A38: g_malloc (gmem.c:159)
==12884==    by 0xC3C729D: g_strdup (gstrfuncs.c:356)
==12884==    by 0x6CC14AD: webkit_web_history_item_get_target (webkitwebhistoryitem.cpp:471)
==12884==    by 0x45D6DE: dumpHistoryItem(_WebKitWebHistoryItem*, int, bool) (DumpRenderTree.cpp:294)
==12884==    by 0x45D9AF: dumpBackForwardListForWebView(_WebKitWebView*) (DumpRenderTree.cpp:345)
==12884==    by 0x45DA10: dumpBackForwardListForAllWebViews() (DumpRenderTree.cpp:356)
==12884==    by 0x45E419: dump() (DumpRenderTree.cpp:561)
==12884==    by 0x45F951: topLoadingFrameLoadFinished() (DumpRenderTree.cpp:1027)
==12884==    by 0x45FA8E: webFrameLoadStatusNotified(_WebKitWebFrame*, void*) (DumpRenderTree.cpp:1057)
Comment 2 Sudarsana Nagineni (babu) 2012-06-05 07:43:07 PDT
Created attachment 145794 [details]
Patch

Fixed memory leaks in DRT code.
Comment 3 WebKit Review Bot 2012-06-05 09:18:57 PDT
Comment on attachment 145794 [details]
Patch

Clearing flags on attachment: 145794

Committed r119495: <http://trac.webkit.org/changeset/119495>
Comment 4 WebKit Review Bot 2012-06-05 09:19:08 PDT
All reviewed patches have been landed.  Closing bug.