Bug 232999

Summary: Fix for thread deadlocks during layout tests in isolated tree mode.
Product: WebKit Reporter: Andres Gonzalez <andresg_22>
Component: AccessibilityAssignee: Andres Gonzalez <andresg_22>
Status: RESOLVED FIXED    
Severity: Normal CC: andresg_22, cfleizach, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description Andres Gonzalez 2021-11-11 08:39:09 PST
Isolated tree mode: Fix for WTR::AccessibilityUIElement calls into the AX API on the AX thread that must hit the main thread.
Comment 1 Radar WebKit Bug Importer 2021-11-11 08:39:22 PST
<rdar://problem/85300861>
Comment 2 Andres Gonzalez 2021-11-11 09:05:36 PST
Created attachment 443954 [details]
Patch
Comment 3 Andres Gonzalez 2021-11-11 09:17:37 PST
Created attachment 443957 [details]
Patch
Comment 4 chris fleizach 2021-11-11 10:14:48 PST
Comment on attachment 443957 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=443957&action=review

> Tools/ChangeLog:10
> +        dispatched to a secndary, mocked thread created by the

secondary

> Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:116
> +        spinMainRunLoop();

we'll need to keep spending the run loop while we wait. 
this also means we don't need this semaphore. we could put a bool in AXThread::dispatch that marks complete and then do a 

while ( !complete ) {
  spinMainRunLoop();
}
Comment 5 Andres Gonzalez 2021-11-11 12:32:20 PST
Created attachment 443988 [details]
Patch
Comment 6 Andres Gonzalez 2021-11-11 12:37:41 PST
(In reply to chris fleizach from comment #4)
> Comment on attachment 443957 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=443957&action=review
> 
> > Tools/ChangeLog:10
> > +        dispatched to a secndary, mocked thread created by the
> 
> secondary

Fixed.
> 
> > Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:116
> > +        spinMainRunLoop();
> 
> we'll need to keep spending the run loop while we wait. 
> this also means we don't need this semaphore. we could put a bool in
> AXThread::dispatch that marks complete and then do a 
> 
> while ( !complete ) {
>   spinMainRunLoop();
> }

Thanks! so much simpler and works.
Comment 7 EWS 2021-11-11 14:46:39 PST
Committed r285671 (244158@main): <https://commits.webkit.org/244158@main>

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