Bug 86240 - [GTK] [WK2] Memory leak in PluginProcessProxy::scanPlugin
Summary: [GTK] [WK2] Memory leak in PluginProcessProxy::scanPlugin
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-05-11 12:09 PDT by Sudarsana Nagineni (babu)
Modified: 2012-05-11 16:07 PDT (History)
4 users (show)

See Also:


Attachments
Patch proposal (2.20 KB, patch)
2012-05-11 12:38 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-05-11 12:09:37 PDT
Valgrind reports a memory leak in PluginProcessProxy::scanPlugin(). It seems stdOut received from g_spawn_sync() needs to be freed.

==19600== 6,400 bytes in 6 blocks are definitely lost in loss record 7,532 of 7,586
==19600==    at 0x4C2B7B2: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19600==    by 0xB1A6AF6: g_realloc (gmem.c:224)
==19600==    by 0xB1BD5C6: g_string_maybe_expand (gstring.c:102)
==19600==    by 0xB1BD8D6: g_string_insert_len (gstring.c:444)
==19600==    by 0xB1DE8AD: read_data (gspawn.c:196)
==19600==    by 0xB1DED3C: g_spawn_sync (gspawn.c:356)
==19600==    by 0x6127CC2: WebKit::PluginProcessProxy::scanPlugin(WTF::String const&, WebKit::RawPluginMetaData&) (PluginProcessProxyGtk.cpp:60)
==19600==    by 0x608F933: WebKit::NetscapePluginModule::getPluginInfo(WTF::String const&, WebKit::PluginModuleInfo&) (NetscapePluginModuleX11.cpp:131)
==19600==    by 0x612830E: WebKit::PluginInfoStore::getPluginInfo(WTF::String const&, WebKit::PluginModuleInfo&) (PluginInfoStoreUnix.cpp:98)
==19600==    by 0x6110CA8: WebKit::PluginInfoStore::loadPlugin(WTF::Vector<WebKit::PluginModuleInfo, 0ul>&, WTF::String const&) (PluginInfoStore.cpp:105)
==19600==    by 0x6110C01: WebKit::PluginInfoStore::loadPluginsIfNecessary() (PluginInfoStore.cpp:95)
==19600==    by 0x6110D07: WebKit::PluginInfoStore::plugins() (PluginInfoStore.cpp:116)
==19600==    by 0x61368AA: WebKit::WebContext::getPlugins(bool, WTF::Vector<WebCore::PluginInfo, 0ul>&) (WebContext.cpp:612)
==19600==    by 0x6287662: void CoreIPC::callMemberFunction<WebKit::WebContext, void (WebKit::WebContext::*)(bool, WTF::Vector<WebCore::PluginInfo, 0ul>&), bool, WTF::Vector<WebCore::
==19600==    by 0x62872B2: void CoreIPC::handleMessage<Messages::WebContext::GetPlugins, WebKit::WebContext, void (WebKit::WebContext::*)(bool, WTF::Vector<WebCore::PluginInfo, 0ul>&)
==19600==    by 0x6286D85: WebKit::WebContext::didReceiveSyncWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, WTF::OwnPtr<CoreIPC::ArgumentEncode
==19600==    by 0x6137268: WebKit::WebContext::didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, WTF::OwnPtr<CoreIPC::ArgumentEncoder>&) (WebC
==19600==    by 0x6198AC3: WebKit::WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, WTF::OwnPtr<CoreIPC::ArgumentEncoder>&)
==19600==    by 0x612FED4: WebKit::WebConnectionToWebProcess::didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, WTF::OwnPtr<CoreIPC::ArgumentE
==19600==    by 0x6056EE8: CoreIPC::Connection::dispatchSyncMessage(CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) (Connection.cpp:647)
==19600==    by 0x6057168: CoreIPC::Connection::dispatchMessage(CoreIPC::Connection::Message<CoreIPC::ArgumentDecoder>&) (Connection.cpp:690)
==19600==    by 0x6054EA5: CoreIPC::Connection::SyncMessageState::dispatchMessages() (Connection.cpp:169)
==19600==    by 0x6054F68: CoreIPC::Connection::SyncMessageState::dispatchMessageAndResetDidScheduleDispatchMessagesWork() (Connection.cpp:181)
==19600==    by 0x60615DB: WTF::FunctionWrapper<void (CoreIPC::Connection::SyncMessageState::*)()>::operator()(CoreIPC::Connection::SyncMessageState*) (Functional.h:173)
==19600==    by 0x6061463: WTF::BoundFunctionImpl<WTF::FunctionWrapper<void (CoreIPC::Connection::SyncMessageState::*)()>, void ()(CoreIPC::Connection::SyncMessageState*)>::operator()
==19600==    by 0x606632D: WTF::Function<void ()()>::operator()() const (Functional.h:613)
==19600==    by 0x6B3BC74: WebCore::RunLoop::performWork() (RunLoop.cpp:67)
==19600==    by 0x75448B1: WebCore::RunLoop::queueWork(WebCore::RunLoop*) (RunLoopGtk.cpp:102)
==19600==    by 0xB1A0C99: g_main_context_dispatch (gmain.c:2515)
==19600==    by 0xB1A105F: g_main_context_iterate.isra.23 (gmain.c:3123)
==19600==    by 0xB1A1459: g_main_loop_run (gmain.c:3317)
==19600==    by 0xA6AD25C: gtk_main (gtkmain.c:1165)
==19600==    by 0x40B12E: main (main.c:233)
Comment 1 Sudarsana Nagineni (babu) 2012-05-11 12:38:26 PDT
Created attachment 141475 [details]
Patch proposal

fix memory leak
Comment 2 Martin Robinson 2012-05-11 13:36:02 PDT
Comment on attachment 141475 [details]
Patch proposal

Thanks!
Comment 3 WebKit Review Bot 2012-05-11 16:07:37 PDT
Comment on attachment 141475 [details]
Patch proposal

Clearing flags on attachment: 141475

Committed r116819: <http://trac.webkit.org/changeset/116819>
Comment 4 WebKit Review Bot 2012-05-11 16:07:47 PDT
All reviewed patches have been landed.  Closing bug.