Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebGPU] Queue::onSubmittedWorkDone may crash if device is destructed #23593

Conversation

mwyrzykowski
Copy link
Contributor

@mwyrzykowski mwyrzykowski commented Jan 31, 2024

d08e8b0

[WebGPU] Queue::onSubmittedWorkDone may crash if device is destructed
https://bugs.webkit.org/show_bug.cgi?id=268474
<radar://122010484>

Reviewed by Dan Glastonbury.

Queue was holding a reference to a device, but its posssible
for the Device to get destroyed prior to the Queue so hold
a WeakPtr instead.

* Source/WebGPU/WebGPU/Device.h:
* Source/WebGPU/WebGPU/Queue.h:
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::submit):
(WebGPU::Queue::writeBuffer):
(WebGPU::Queue::device const):
(WebGPU::Queue::clearTexture):
(WebGPU::Queue::writeTexture):
(WebGPU::Queue::scheduleWork):

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

4cde87a

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🛠 gtk
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@mwyrzykowski mwyrzykowski self-assigned this Jan 31, 2024
@mwyrzykowski mwyrzykowski added the WebGPU For bugs in WebGPU label Jan 31, 2024
@mwyrzykowski mwyrzykowski requested a review from djg January 31, 2024 17:14
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 31, 2024
@mwyrzykowski mwyrzykowski removed the merging-blocked Applied to prevent a change from being merged label Jan 31, 2024
@mwyrzykowski mwyrzykowski force-pushed the eng/WebGPU-QueueonSubmittedWorkDone-may-crash-if-device-is-destructed branch from 030f2bc to 4cde87a Compare January 31, 2024 17:49
Copy link
Contributor

@djg djg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@mwyrzykowski mwyrzykowski added the merge-queue Applied to send a pull request to merge-queue label Feb 1, 2024
https://bugs.webkit.org/show_bug.cgi?id=268474
<radar://122010484>

Reviewed by Dan Glastonbury.

Queue was holding a reference to a device, but its posssible
for the Device to get destroyed prior to the Queue so hold
a WeakPtr instead.

* Source/WebGPU/WebGPU/Device.h:
* Source/WebGPU/WebGPU/Queue.h:
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::submit):
(WebGPU::Queue::writeBuffer):
(WebGPU::Queue::device const):
(WebGPU::Queue::clearTexture):
(WebGPU::Queue::writeTexture):
(WebGPU::Queue::scheduleWork):

Canonical link: https://commits.webkit.org/273870@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WebGPU-QueueonSubmittedWorkDone-may-crash-if-device-is-destructed branch from 4cde87a to d08e8b0 Compare February 1, 2024 01:04
@webkit-commit-queue
Copy link
Collaborator

Committed 273870@main (d08e8b0): https://commits.webkit.org/273870@main

Reviewed commits have been landed. Closing PR #23593 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit d08e8b0 into WebKit:main Feb 1, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebGPU For bugs in WebGPU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants