Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: acff513d2d4e37e447ca336e02f58b56f97ed639
      
https://github.com/WebKit/WebKit/commit/acff513d2d4e37e447ca336e02f58b56f97ed639
  Author: Mike Wyrzykowski <[email protected]>
  Date:   2025-01-07 (Tue, 07 Jan 2025)

  Changed paths:
    A LayoutTests/fast/webgpu/nocrash/fuzz-285311-expected.txt
    A LayoutTests/fast/webgpu/nocrash/fuzz-285311.html
    M Source/WebGPU/WebGPU/CommandBuffer.mm

  Log Message:
  -----------
  [WebGPU] CommandEncoder is set to nullptr on a different thread
https://bugs.webkit.org/show_bug.cgi?id=285311
rdar://142217786

Reviewed by Tadeu Zagallo.

287497@main retained the CommandEncoder until its corresponding MTLCommandBuffer
completed to avoid an apparent retain count bug in the shader validation layer,
however in doing so, the non-thread safe RefPtr was set to nullptr off the 
thread
it was created on. This could lead to potential races when iterating over a 
WeakHashSet
of the corresponding type.

Address this by setting the member variable to nullptr on the work queue's
thread.

* Source/WebGPU/WebGPU/CommandBuffer.mm:
(WebGPU::CommandBuffer::makeInvalidDueToCommit):
Set to nullptr on the appropriate thread.

* LayoutTests/fast/webgpu/nocrash/fuzz-285311-expected.txt: Added.
* LayoutTests/fast/webgpu/nocrash/fuzz-285311.html: Added.
Add regression test.

Canonical link: https://commits.webkit.org/288538@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to