Bug 173110

Summary: [Cocoa] JSWrapperMap leaks for all JSContexts
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, ggaren, joepeck, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Joseph Pecoraro
Reported 2017-06-08 14:17:26 PDT
Summary: JSWrapperMap leaks for all JSContexts Test: /* * shell> xcrun clang -framework Foundation -framework JavaScriptCore js-leak.m */ #import <Foundation/Foundation.h> #import <JavaScriptCore/JavaScriptCore.h> int main() { @autoreleasepool { [[[JSContext alloc] init] autorelease]; } [[NSRunLoop mainRunLoop] run]; return 0; } Steps to Reproduce: 1. $ xcrun clang -framework Foundation -framework JavaScriptCore js-leak.m 2. $ MallocStackLogging=1 DYLD_FRAMEWORK_PATH=$build/Release ./a.out 3. $ leaks `pidof a.out` => Leaks Leak: Leak: 0x7f9b18100ce0 size=32 zone: DefaultMallocZone_0x10ecb8000 JSWrapperMap ObjC JavaScriptCore 0x0e58d0f5 0x001d8001 0x181008d0 0x00007f9b ..X............. 0x186125c0 0x00007f9b 0x18100ec0 0x00007f9b .%a............. Call stack: [thread 0x7fffb956e3c0]: | start | main | -[JSContext initWithVirtualMachine:] JSContext.mm:79 | -[JSContext ensureWrapperMap] JSContext.mm:57 | _objc_rootAlloc | class_createInstance | calloc
Attachments
[PATCH] Proposed Fix (1.37 KB, patch)
2017-06-08 14:23 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2017-06-08 14:17:40 PDT
Joseph Pecoraro
Comment 2 2017-06-08 14:23:42 PDT
Created attachment 312342 [details] [PATCH] Proposed Fix
Geoffrey Garen
Comment 3 2017-06-08 14:48:03 PDT
Comment on attachment 312342 [details] [PATCH] Proposed Fix r=me
WebKit Commit Bot
Comment 4 2017-06-08 15:24:14 PDT
Comment on attachment 312342 [details] [PATCH] Proposed Fix Clearing flags on attachment: 312342 Committed r217952: <http://trac.webkit.org/changeset/217952>
WebKit Commit Bot
Comment 5 2017-06-08 15:24:16 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.