Bug 18488

Summary: FastMalloc doesn't release thread-specific data on Windows
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: Web Template FrameworkAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
proposed fix aroben: review+

Description Alexey Proskuryakov 2008-04-14 06:09:51 PDT
FastMalloc uses pthreads support for thread-specific storage to make sure that destructors for data get called. However, pthreads-win32 only calls those from pthread_exit (or when the thread's main function returns, but only for threads created with pthread_create).

Since ThreadingWin.cpp uses native Win32 functions, I believe that this data just leaks when a thread finishes.

Patch forthcoming.
Comment 1 Alexey Proskuryakov 2008-04-14 06:17:16 PDT
Created attachment 20529 [details]
proposed fix
Comment 2 Adam Roben (:aroben) 2008-04-14 08:59:56 PDT
Comment on attachment 20529 [details]
proposed fix

+#include <process.h>
 #include "MainThread.h"
 #include <windows.h>
 #include <wtf/HashMap.h>
 #include <wtf/MathExtras.h>

I think process.h should be moved below MainThread.h

+unsigned __stdcall wtfThreadEntryPoint(void* param)

I think this should be declared static.

r=me
Comment 3 Alexey Proskuryakov 2008-04-14 09:34:04 PDT
Committed revision 31864 with suggested changes.