Bug 144860 - AX: Crash at WebCore::AccessibilityMenuList::addChildren()
Summary: AX: Crash at WebCore::AccessibilityMenuList::addChildren()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-11 00:47 PDT by chris fleizach
Modified: 2015-05-11 13:26 PDT (History)
10 users (show)

See Also:


Attachments
patch (4.19 KB, patch)
2015-05-11 00:52 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
patch (4.19 KB, patch)
2015-05-11 00:53 PDT, chris fleizach
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2015-05-11 00:47:52 PDT
It's possible to make AX code crash in AXMenuList when trying to access children after the object has been hidden

<rdar://problem/20774337>
Comment 1 chris fleizach 2015-05-11 00:52:06 PDT
Created attachment 252845 [details]
patch
Comment 2 chris fleizach 2015-05-11 00:53:46 PDT
Created attachment 252846 [details]
patch
Comment 3 Mario Sanchez Prada 2015-05-11 02:43:31 PDT
Comment on attachment 252846 [details]
patch

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

> Source/WebCore/accessibility/AccessibilityMenuList.cpp:67
> -    m_haveChildren = true;
> -
> -    AXObjectCache* cache = m_renderer->document().axObjectCache();
> -
> +    if (!m_renderer)
> +        return;
> +    
> +    AXObjectCache* cache = axObjectCache();
> +    if (!cache)
> +        return;
> +    

Indeed. This was an accident waiting to happen.
Comment 4 WebKit Commit Bot 2015-05-11 08:09:26 PDT
Comment on attachment 252846 [details]
patch

Clearing flags on attachment: 252846

Committed r184097: <http://trac.webkit.org/changeset/184097>
Comment 5 WebKit Commit Bot 2015-05-11 08:09:31 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Andreas Kling 2015-05-11 12:53:08 PDT
This test is failing on Windows bots since it was added:

https://build.webkit.org/results/Apple%20Win%207%20Debug%20(Tests)/r184105%20(66146)/accessibility/menu-list-crash2-pretty-diff.html

--- /home/buildbot/slave/win-debug-tests/build/layout-test-results/accessibility/menu-list-crash2-expected.txt
+++ /home/buildbot/slave/win-debug-tests/build/layout-test-results/accessibility/menu-list-crash2-actual.txt
@@ -5,8 +5,8 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-Role before removal: AXRole: AXPopUpButton
-Role after removal: AXRole: 
+Role before removal: AXRole: AXComboBox
+Role after removal: AXRole: AXComboBox
 PASS successfullyParsed is true
 
 TEST COMPLETE
Comment 7 chris fleizach 2015-05-11 13:13:58 PDT
We need a windows expectation file

I can do that today but not for a few hours

(In reply to comment #6)
> This test is failing on Windows bots since it was added:
> 
> https://build.webkit.org/results/Apple%20Win%207%20Debug%20(Tests)/
> r184105%20(66146)/accessibility/menu-list-crash2-pretty-diff.html
> 
> ---
> /home/buildbot/slave/win-debug-tests/build/layout-test-results/accessibility/
> menu-list-crash2-expected.txt
> +++
> /home/buildbot/slave/win-debug-tests/build/layout-test-results/accessibility/
> menu-list-crash2-actual.txt
> @@ -5,8 +5,8 @@
>  On success, you will see a series of "PASS" messages, followed by "TEST
> COMPLETE".
>  
>  
> -Role before removal: AXRole: AXPopUpButton
> -Role after removal: AXRole: 
> +Role before removal: AXRole: AXComboBox
> +Role after removal: AXRole: AXComboBox
>  PASS successfullyParsed is true
>  
>  TEST COMPLETE
Comment 8 Andreas Kling 2015-05-11 13:26:44 PDT
(In reply to comment #7)
> We need a windows expectation file
> 
> I can do that today but not for a few hours

I'll land one then :)