[Webkit-unassigned] [Bug 116139] New: [WK2] LEAK: ThreadFunctionInvocation* seems to be leaked in createThreadInternal

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 14 23:17:38 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=116139

           Summary: [WK2] LEAK: ThreadFunctionInvocation* seems to be
                    leaked in createThreadInternal
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ktf.kim at samsung.com
                CC: kalevlember at gmail.com


The below memory leak issue was found with Valgrind: 

==6322== 8 bytes in 1 blocks are definitely lost in loss record 144 of 1,256
==6322==    at 0x483486C: operator new(unsigned int) (vg_replace_malloc.c:292)
==6322==    by 0x5BE888B: WTF::createThreadInternal(void (*)(void*), void*, char const*) (ThreadingPthreads.cpp:164)
==6322==    by 0x5BD5DFF: WTF::createThread(void (*)(void*), void*, char const*) (Threading.cpp:86)
==6322==    by 0x4C5E1D7: WorkQueue::platformInitialize(char const*) (WorkQueueEfl.cpp:62)
==6322==    by 0x4CEAB8D: WebKit::WebProcessProxy::connect() (WorkQueue.cpp:32)
==6322==    by 0x4D54951: WebKit::WebProcessProxy::WebProcessProxy(WTF::PassRefPtr<WebKit::WebContext>) (WebProcessProxy.cpp:85)
==6322==    by 0x4D54999: WebKit::WebContext::ensureWebProcess() (WebProcessProxy.cpp:71)
==6322==    by 0x4D58181: WebKit::WebContext::createWebPage(WebKit::PageClient*, WebKit::WebPageGroup*) (WebContext.cpp:502)
==6322==    by 0x4C7CB4F: _ewk_view_initialize(_Evas_Object*, WTF::PassRefPtr<Ewk_Context>, OpaqueWKPageGroup const*) (ewk_view.cpp:1240)
==6322==    by 0x4C7D1F3: ewk_view_smart_add (ewk_view.cpp:1418)
==6322==    by 0x4C7D433: ewk_view_add_with_context (ewk_view.cpp:1429)
==6322==    by 0x4C7D4C3: ewk_view_add (ewk_view.cpp:1434)

The variable "invocation" is allocated in createThreadInterna, and passed to "pthread_create".
I think the "pthread_create" doesn't manage the "void *arg" argument, so some routine is needed to free that pointer.

ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*) {
    OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
    pthread_t threadHandle;
    if (pthread_create(&threadHandle, 0, wtfThreadEntryPoint, invocation.get()))
        return 0;
    ThreadFunctionInvocation* leakedInvocation = invocation.leakPtr();

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list