RESOLVED FIXED227875
Regression(r279601) ProcessAssertion may get destroyed on a background thread
https://bugs.webkit.org/show_bug.cgi?id=227875
Summary Regression(r279601) ProcessAssertion may get destroyed on a background thread
Chris Dumez
Reported 2021-07-12 08:54:45 PDT
r279601 added an internal WorkQueue to ProcessAssertion, so that we could acquire the RunningBoard assertion asynchronously on the background queue. When dispatching to the background queue, we capture |protectedThis|, which means that ProcessAssertion may now get destroyed on the background queue. ProcessAssertion is a main thread object and destroying it on a non-main thread can lead to crashes.
Attachments
Patch (2.98 KB, patch)
2021-07-12 08:56 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (2.99 KB, patch)
2021-07-12 09:04 PDT, Chris Dumez
no flags
Patch (2.18 KB, patch)
2021-07-12 11:47 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-07-12 08:54:58 PDT
Chris Dumez
Comment 2 2021-07-12 08:56:23 PDT
Chris Dumez
Comment 3 2021-07-12 09:04:51 PDT
Geoffrey Garen
Comment 4 2021-07-12 10:12:28 PDT
Comment on attachment 433325 [details] Patch r=me
EWS
Comment 5 2021-07-12 10:26:07 PDT
Committed r279835 (239595@main): <https://commits.webkit.org/239595@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433325 [details].
Chris Dumez
Comment 6 2021-07-12 11:07:07 PDT
Reverted r279835 for reason: Newly added assertions are wrong Committed r279840 (239599@main): <https://commits.webkit.org/239599@main>
Chris Dumez
Comment 7 2021-07-12 11:11:04 PDT
Comment on attachment 433325 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433325&action=review > Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:324 > + ASSERT(isMainRunLoop()); WebSQLiteDatabaseTracker takes and releases assertions on a non-main thread (with a lock) so those assertions hit in debug. I am reworking the patch.
Chris Dumez
Comment 8 2021-07-12 11:47:29 PDT
Chris Dumez
Comment 9 2021-07-12 14:39:31 PDT
Comment on attachment 433338 [details] Patch Requesting review again because the patch has changed substantially.
Geoffrey Garen
Comment 10 2021-07-13 10:07:01 PDT
Comment on attachment 433338 [details] Patch r=me
EWS
Comment 11 2021-07-13 10:10:19 PDT
Committed r279877 (239630@main): <https://commits.webkit.org/239630@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433338 [details].
Chris Dumez
Comment 12 2021-07-26 08:43:49 PDT
This was actually rdar://problem/80344055
Note You need to log in before you can comment on or make changes to this bug.