Bug 229781 - Leak of VTImageRotationSessionRef (176 bytes) in com.apple.WebKit.GPU.Development process
Summary: Leak of VTImageRotationSessionRef (176 bytes) in com.apple.WebKit.GPU.Develop...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on: 229265
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-01 17:11 PDT by David Kilzer (:ddkilzer)
Modified: 2021-09-02 13:31 PDT (History)
5 users (show)

See Also:


Attachments
Patch v1 (1.69 KB, patch)
2021-09-01 17:16 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2021-09-01 17:11:27 PDT
Leak of VTImageRotationSessionRef (176 bytes) in com.apple.WebKit.GPU.Development process.

STACK OF 1 INSTANCE OF 'ROOT LEAK: <VTImageRotationSession>':
21  com.apple.WebKit.GPU.Development        0x102b79000 0x102b79000 + 0
19  dyld                                  0x10902d4d5 start + 421
18  WebKit                                0x104f6ca30 WebKit::XPCServiceMain(int, char const**) + 137  XPCServiceMain.mm:243
17  libxpc.dylib                       0x7ff80766dc22 xpc_main + 99
16  libxpc.dylib                       0x7ff80766e233 _xpc_objc_main + 825
15  com.apple.Foundation               0x7ff8087f6a03 -[NSRunLoop(NSRunLoop) run] + 76
14  com.apple.Foundation               0x7ff80876c66e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 216
13  com.apple.CoreFoundation           0x7ff8079e1dd9 CFRunLoopRunSpecific + 567
12  com.apple.CoreFoundation           0x7ff8079e282f __CFRunLoopRun + 897
11  com.apple.CoreFoundation           0x7ff8079e3e13 __CFRunLoopDoSources0 + 242
10  com.apple.CoreFoundation           0x7ff8079e40a0 __CFRunLoopDoSource0 + 180
9   com.apple.CoreFoundation           0x7ff8079e4138 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
8   JavaScriptCore                        0x10adcc1c2 WTF::RunLoop::performWork(void*) + 34  RunLoopCF.cpp:47
7   JavaScriptCore                        0x10adcb8ef WTF::RunLoop::performWork() + 431  RunLoop.cpp:134
6   WebCore                               0x10da46a54 WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged() + 1476  MediaPlayerPrivateAVFoundationObjC.mm:2108
5   WebCore                               0x10da48aa5 WebCore::MediaPlayerPrivateAVFoundationObjC::updateRotationSession() + 773  MediaPlayerPrivateAVFoundationObjC.mm:2200
4   WebCore                               0x10d9e5bc0 WebCore::ImageRotationSessionVT::ImageRotationSessionVT(WebCore::AffineTransform&&, WebCore::FloatSize, WebCore::ImageRotationSessionVT::IsCGImageCompatible) + 128  ImageRotationSessionVT.mm:0
3   WebCore                               0x10d9e5d2c WebCore::ImageRotationSessionVT::initialize(WebCore::ImageRotationSessionVT::RotationProperties const&, WebCore::FloatSize, WebCore::ImageRotationSessionVT::IsCGImageCompatible) + 236  ImageRotationSessionVT.mm:86
2   com.apple.VideoToolbox             0x7ff8142f4930 VTImageRotationSessionCreate + 143
1   com.apple.CoreFoundation           0x7ff807967d90 _CFRuntimeCreateInstance + 580
0   libsystem_malloc.dylib             0x7ff807757d52 _malloc_zone_malloc + 249 
====
    2 (176 bytes) ROOT LEAK: <VTImageRotationSession 0x7fdbbe949ca0> [144]
       1 (32 bytes) <NSMutableDictionary 0x7fdbbe9415c0> [32]
Comment 1 David Kilzer (:ddkilzer) 2021-09-01 17:11:43 PDT
<rdar://problem/82651897>
Comment 2 David Kilzer (:ddkilzer) 2021-09-01 17:13:40 PDT
Missing an adoptCF() in Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm:

    VTImageRotationSessionRef rawRotationSession = nullptr;
    VTImageRotationSessionCreate(kCFAllocatorDefault, m_rotationProperties.angle, &rawRotationSession);
    m_rotationSession = rawRotationSession;
Comment 3 David Kilzer (:ddkilzer) 2021-09-01 17:16:38 PDT
Created attachment 437089 [details]
Patch v1
Comment 4 David Kilzer (:ddkilzer) 2021-09-02 11:37:48 PDT
The mac-debug-wk1 failures are not related to this patch.

See:  <https://trac.webkit.org/changeset/281934/webkit>
Comment 5 EWS 2021-09-02 13:31:38 PDT
Committed r281950 (241257@main): <https://commits.webkit.org/241257@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437089 [details].