[Webkit-unassigned] [Bug 244008] New: Leak of id<MTLArgumentEncoder> in rx::(anonymous)::InitArgumentBufferEncoder()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 16 14:04:36 PDT 2022


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

            Bug ID: 244008
           Summary: Leak of id<MTLArgumentEncoder> in
                    rx::(anonymous)::InitArgumentBufferEncoder()
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: ANGLE
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org
                CC: dino at apple.com, kbr at google.com, kkinnunen at apple.com

Leak of id<MTLArgumentEncoder> in rx::(anonymous)::InitArgumentBufferEncoder().

The struct is defined like this in ProgramMtl.h:

```
struct ProgramArgumentBufferEncoderMtl
{
    void reset(ContextMtl *contextMtl);

    mtl::AutoObjCPtr<id<MTLArgumentEncoder>> metalArgBufferEncoder;
    mtl::BufferPool bufferPool;
};
```

However the method doesn't adopt the object in ProgramMtl.mm, which causes it to be assigned with a +2 retain count:

```
void InitArgumentBufferEncoder(mtl::Context *context,
                               id<MTLFunction> function,
                               uint32_t bufferIndex,
                               ProgramArgumentBufferEncoderMtl *encoder)
{
    encoder->metalArgBufferEncoder = [function newArgumentEncoderWithBufferIndex:bufferIndex];   // LEAK!
    if (encoder->metalArgBufferEncoder)
    {
        encoder->bufferPool.initialize(context, encoder->metalArgBufferEncoder.get().encodedLength,
                                       mtl::kArgumentBufferOffsetAlignment, 0);
    }
}
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220816/7ffeb25b/attachment.htm>


More information about the webkit-unassigned mailing list