Bug 250346 - AX: With ITM enabled, reloading the page causes a deadlock
Summary: AX: With ITM enabled, reloading the page causes a deadlock
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-09 16:19 PST by Tyler Wilcock
Modified: 2023-01-10 10:40 PST (History)
10 users (show)

See Also:


Attachments
Patch (7.38 KB, patch)
2023-01-09 16:32 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (6.55 KB, patch)
2023-01-09 19:45 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (9.02 KB, patch)
2023-01-09 23:47 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2023-01-09 16:19:40 PST
This is caused by unconditional re-entrant acquisition of s_storeLock when an isolated tree is destroyed.
Comment 1 Radar WebKit Bug Importer 2023-01-09 16:19:54 PST
<rdar://problem/104050533>
Comment 2 Tyler Wilcock 2023-01-09 16:21:08 PST
rdar://104018097
Comment 3 Tyler Wilcock 2023-01-09 16:32:59 PST
Created attachment 464430 [details]
Patch
Comment 4 Andres Gonzalez 2023-01-09 18:13:18 PST
(In reply to Tyler Wilcock from comment #3)
> Created attachment 464430 [details]
> Patch

I think the right fix is to remove this line from applyPendingchanges:

        Locker locker { s_storeLock };

because the new AXTreeStore takes care of the lock for each one of the operations it performs.

Notice that otherwise the problem is still there in debug builds for the block that follows:

#ifndef NDEBUG
        ASSERT(AXTreeStore::contains(treeID()));
...


Should make sure that we are not acquiring the store lock somewhere else unnecessarily.
Comment 5 Tyler Wilcock 2023-01-09 19:45:48 PST
Created attachment 464437 [details]
Patch
Comment 6 Tyler Wilcock 2023-01-09 23:47:32 PST
Created attachment 464440 [details]
Patch
Comment 7 EWS 2023-01-10 10:40:46 PST
Committed 258735@main (9cdd3b498e3e): <https://commits.webkit.org/258735@main>

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