Bug 198871

Summary: [Cocoa] NSFileWrapper associated with _WKAttachment is leaking
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebKit Misc.Assignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, joepeck, mitz, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2019-06-14 14:59:08 PDT
NSFileWrapper associated with _WKAttachment is leaking, along with other properties specifically in API::Attachment:

STACK OF 2 INSTANCES OF 'ROOT LEAK: malloc<32>':
18  libdyld.dylib                         0x1d82dde7c start + 4
17  com.apple.mobilemail                  0x104cbfff0 0x104cb8000 + 32752
16  com.apple.UIKitCore                   0x106fb4db8 UIApplicationMain + 1936
15  com.apple.GraphicsServices            0x1d6f84180 GSEventRunModal + 104
14  com.apple.CoreFoundation              0x1d7d877ac CFRunLoopRunSpecific + 464
13  com.apple.CoreFoundation              0x1d7d882a8 __CFRunLoopRun + 2004
12  com.apple.CoreFoundation              0x1d7d8d2a0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
11  libdispatch.dylib                     0x1d85ea1f8 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1044
10  libdispatch.dylib                     0x1d86381ec _dispatch_client_callout + 16
9   libdispatch.dylib                     0x1d8637678 _dispatch_call_block_and_release + 24
8   ???                                   0x105960044 ???
7   ???                                   0x10654c5cc ???
6   com.apple.WebKit                      0x1d10a0f00 -[_WKAttachment setFileWrapper:contentType:completion:] + 200
5   com.apple.WebKit                      0x1d10717cc API::Attachment::setFileWrapperAndUpdateContentType(NSFileWrapper*, NSString*) + 356
4   JavaScriptCore                        0x1dbd792dc WTF::String::String(NSString*) + 12
3   JavaScriptCore                        0x1dbd79048 WTF::String::String(NSString*) + 204
2   JavaScriptCore                        0x1dbd7998c WTF::StringImpl::create(unsigned char const*, unsigned int) + 56
1   JavaScriptCore                        0x1dbdc2194 bmalloc::DebugHeap::malloc(unsigned long, bool) + 24
0   libsystem_malloc.dylib                0x1d867177c malloc_zone_malloc + 200 
====
    2 (64 bytes) << TOTAL >>
      1 (32 bytes) ROOT LEAK: 0x114e01ae0 [32]
      1 (32 bytes) ROOT LEAK: 0x114f00fc0 [32]
Comment 1 Joseph Pecoraro 2019-06-14 14:59:38 PDT
<rdar://problem/51760625>
Comment 2 Joseph Pecoraro 2019-06-14 15:00:46 PDT
Created attachment 372145 [details]
[PATCH] Proposed Fix
Comment 3 WebKit Commit Bot 2019-06-14 15:52:30 PDT
Comment on attachment 372145 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 372145

Committed r246448: <https://trac.webkit.org/changeset/246448>
Comment 4 WebKit Commit Bot 2019-06-14 15:52:32 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 mitz 2019-06-14 16:28:37 PDT
Comment on attachment 372145 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=372145&action=review

> Source/WebKit/ChangeLog:3
> +        [Cocoa] NSFileWrapper associated with _WKAttachment

is leaking
Comment 6 Joseph Pecoraro 2019-06-14 17:06:58 PDT
Comment on attachment 372145 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=372145&action=review

>> Source/WebKit/ChangeLog:3
>> +        [Cocoa] NSFileWrapper associated with _WKAttachment
> 
> is leaking

Doh, thanks.