<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>133825</bug_id>
          
          <creation_ts>2014-06-12 14:51:22 -0700</creation_ts>
          <short_desc>AX: Safari crashed once in WebCore::AccessibilityObject::ariaIsHidden</short_desc>
          <delta_ts>2014-06-16 14:44:51 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Accessibility</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="chris fleizach">cfleizach</reporter>
          <assigned_to name="chris fleizach">cfleizach</assigned_to>
          <cc>aboxhall</cc>
    
    <cc>apinheiro</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>dmazzoni</cc>
    
    <cc>jcraig</cc>
    
    <cc>jdiggs</cc>
    
    <cc>koivisto</cc>
    
    <cc>mario</cc>
    
    <cc>samuel_white</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1015241</commentid>
    <comment_count>0</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-06-12 14:51:22 -0700</bug_when>
    <thetext>Crash log here

#0	0x00000001005deee0 in WebCore::AccessibilityObject::element() const at /Code/Web/OpenSource/Source/WebCore/accessibility/AccessibilityObject.cpp:1874
#1	0x00000001005d9710 in WebCore::AccessibilityObject::getAttribute(WebCore::QualifiedName const&amp;) const at /Code/Web/OpenSource/Source/WebCore/accessibility/AccessibilityObject.cpp:1686
#2	0x00000001005edd54 in WebCore::AccessibilityObject::isARIAHidden() const at /Code/Web/OpenSource/Source/WebCore/accessibility/AccessibilityObject.cpp:2373
#3	0x00000001005ede80 in WebCore::AccessibilityObject::defaultObjectInclusion() const at /Code/Web/OpenSource/Source/WebCore/accessibility/AccessibilityObject.cpp:2393
#4	0x00000001005f22f8 in WebCore::AccessibilityRenderObject::defaultObjectInclusion() const at /Code/Web/OpenSource/Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1166
#5	0x00000001005f2370 in WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored() const at /Code/Web/OpenSource/Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1178
#6	0x00000001005edfe8 in WebCore::AccessibilityObject::accessibilityIsIgnored() const at /Code/Web/OpenSource/Source/WebCore/accessibility/AccessibilityObject.cpp:2420
#7	0x00000001005d2bf0 in WebCore::AXObjectCache::notificationPostTimerFired(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;) at /Code/Web/OpenSource/Source/WebCore/accessibility/AXObjectCache.cpp:738
#8	0x0000000100633030 in decltype(*(std::__1::forward&lt;WebCore::AXObjectCache*&amp;&gt;(fp0)).*fp(std::__1::forward&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;&gt;(fp1))) std::__1::__invoke&lt;void (WebCore::AXObjectCache::*&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), WebCore::AXObjectCache*&amp;, WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;, void&gt;(void (WebCore::AXObjectCache::*&amp;&amp;&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), WebCore::AXObjectCache*&amp;&amp;&amp;, WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;&amp;&amp;) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/iOS8.0.xctoolchain/usr/bin/../include/c++/v1/__functional_base:380
#9	0x0000000100632fc0 in std::__1::__bind_return&lt;void (WebCore::AXObjectCache::*)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), std::__1::tuple&lt;WebCore::AXObjectCache*, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;, std::__1::tuple&lt;&gt;, _is_valid_bind_return&lt;void (WebCore::AXObjectCache::*)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), std::__1::tuple&lt;WebCore::AXObjectCache*, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;, std::__1::tuple&lt;&gt; &gt;::value&gt;::type std::__1::__apply_functor&lt;void (WebCore::AXObjectCache::*)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), std::__1::tuple&lt;WebCore::AXObjectCache*, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;, 0ul, 1ul, std::__1::tuple&lt;&gt; &gt;(void (WebCore::AXObjectCache::*&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), std::__1::tuple&lt;WebCore::AXObjectCache*, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;&amp;, std::__1::__tuple_indices&lt;0ul, 1ul&gt;, std::__1::tuple&lt;&gt;&amp;&amp;) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/iOS8.0.xctoolchain/usr/bin/../include/c++/v1/functional:2022
#10	0x0000000100632f78 in std::__1::__bind_return&lt;void (WebCore::AXObjectCache::*)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), std::__1::tuple&lt;WebCore::AXObjectCache*, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;, std::__1::tuple&lt;&gt;, _is_valid_bind_return&lt;void (WebCore::AXObjectCache::*)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), std::__1::tuple&lt;WebCore::AXObjectCache*, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;, std::__1::tuple&lt;&gt; &gt;::value&gt;::type std::__1::__bind&lt;void (WebCore::AXObjectCache::*&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), WebCore::AXObjectCache*&amp;, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;::operator()&lt;&gt;() [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/iOS8.0.xctoolchain/usr/bin/../include/c++/v1/functional:2085
#11	0x0000000100632f60 in decltype(std::__1::forward&lt;std::__1::__bind&lt;void (WebCore::AXObjectCache::*&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), WebCore::AXObjectCache*&amp;, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;&amp;&gt;(fp)(std::__1::forward&lt;&gt;(fp0))) std::__1::__invoke&lt;std::__1::__bind&lt;void (WebCore::AXObjectCache::*&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), WebCore::AXObjectCache*&amp;, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;&amp;&gt;(std::__1::__bind&lt;void (WebCore::AXObjectCache::*&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), WebCore::AXObjectCache*&amp;, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;&amp;&amp;&amp;) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/iOS8.0.xctoolchain/usr/bin/../include/c++/v1/__functional_base:413
#12	0x0000000100632f60 in std::__1::__function::__func&lt;std::__1::__bind&lt;void (WebCore::AXObjectCache::*&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), WebCore::AXObjectCache*&amp;, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt;, std::__1::allocator&lt;std::__1::__bind&lt;void (WebCore::AXObjectCache::*&amp;)(WebCore::Timer&lt;WebCore::AXObjectCache&gt;&amp;), WebCore::AXObjectCache*&amp;, std::__1::reference_wrapper&lt;WebCore::Timer&lt;WebCore::AXObjectCache&gt; &gt; &gt; &gt;, void ()&gt;::operator()() at /Applications/Xcode.app/Contents/Developer/Toolchains/iOS8.0.xctoolchain/usr/bin/../include/c++/v1/functional:1370
#13	0x0000000100632230 in std::__1::function&lt;void ()&gt;::operator()() const at /Applications/Xcode.app/Contents/Developer/Toolchains/iOS8.0.xctoolchain/usr/bin/../include/c++/v1/functional:1755
#14	0x00000001006321ec in WebCore::Timer&lt;WebCore::AXObjectCache&gt;::fired() at /Code/Web/OpenSource/Source/WebCore/platform/Timer.h:133
#15	0x00000001022a1a38 in WebCore::ThreadTimers::sharedTimerFiredInternal() at /Code/Web/OpenSource/Source/WebCore/platform/ThreadTimers.cpp:132
#16	0x00000001022a1730 in WebCore::ThreadTimers::sharedTimerFired() at /Code/Web/OpenSource/Source/WebCore/platform/ThreadTimers.cpp:107
#17	0x0000000101fe8004 in WebCore::timerFired(__CFRunLoopTimer*, void*) at /Code/Web/OpenSource/Source/WebCore/platform/ios/SharedTimerIOS.mm:62</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015242</commentid>
    <comment_count>1</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-06-12 14:51:42 -0700</bug_when>
    <thetext>The problem looks like if you ask axIsIgnored() on a newly created object, it can actually deallocate itself</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015244</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2014-06-12 14:52:05 -0700</bug_when>
    <thetext>&lt;rdar://problem/17292966&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015245</commentid>
    <comment_count>3</comment_count>
      <attachid>232992</attachid>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-06-12 14:54:38 -0700</bug_when>
    <thetext>Created attachment 232992
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015939</commentid>
    <comment_count>4</comment_count>
      <attachid>232992</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-06-16 13:15:20 -0700</bug_when>
    <thetext>Comment on attachment 232992
patch

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

&gt; Source/WebCore/accessibility/AXObjectCache.cpp:433
&gt; +    // Sometimes asking accessibilityIsIgnored() will cause the newObject to be deallocated, and then
&gt; +    // it will disappear when this function is finished, leading to a use-after-free.
&gt; +    if (newObj-&gt;isDetached())
&gt; +        return nullptr;

Do you really mean deallocated, or just detached? If newObj is truly deallocated, we need to understand why our RefPtr didn&apos;t prevent that. Accessing newObj after it has been deallocated is not sound, and isDetached() might return anything if it&apos;s called on a deallocated object.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015940</commentid>
    <comment_count>5</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-06-16 13:22:29 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 232992 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=232992&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:433
&gt; &gt; +    // Sometimes asking accessibilityIsIgnored() will cause the newObject to be deallocated, and then
&gt; &gt; +    // it will disappear when this function is finished, leading to a use-after-free.
&gt; &gt; +    if (newObj-&gt;isDetached())
&gt; &gt; +        return nullptr;
&gt; 
&gt; Do you really mean deallocated, or just detached? If newObj is truly deallocated, we need to understand why our RefPtr didn&apos;t prevent that. Accessing newObj after it has been deallocated is not sound, and isDetached() might return anything if it&apos;s called on a deallocated object.

I mean detached. The RefPtr&lt;&gt; in this method is still holding onto the object while we&apos;re in the context of the methods stack. as soon as we leave that stack and the RefPtr goes away, the object then becomes deallocated</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015944</commentid>
    <comment_count>6</comment_count>
      <attachid>232992</attachid>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2014-06-16 13:32:24 -0700</bug_when>
    <thetext>Comment on attachment 232992
patch

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

&gt; Source/WebCore/ChangeLog:8
&gt; +        Sometimes asking accessibilityIsIgnored() will cause a newObject to be deallocated. It will

Please fix the ChangeLog to use detached.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015968</commentid>
    <comment_count>7</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-06-16 14:44:51 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/170028</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>232992</attachid>
            <date>2014-06-12 14:54:38 -0700</date>
            <delta_ts>2014-06-16 13:32:24 -0700</delta_ts>
            <desc>patch</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>2534</size>
            <attacher name="chris fleizach">cfleizach</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE2OTkxMikKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIyIEBACisyMDE0LTA2LTEyICBDaHJpcyBG
bGVpemFjaCAgPGNmbGVpemFjaEBhcHBsZS5jb20+CisKK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qZWN0LmNwcAo9PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09Ci0tLSBTb3VyY2UvV2ViQ29yZS9hY2Nlc3NpYmlsaXR5L0FjY2Vzc2liaWxpdHlPYmpl
Y3QuY3BwCShyZXZpc2lvbiAxNjk3NDcpCisrKyBTb3VyY2UvV2ViQ29yZS9hY2Nlc3NpYmlsaXR5
L0FjY2Vzc2liaWxpdHlPYmplY3QuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0xNDI5LDggKzE0Mjks
MTAgQEAKIHZvaWQgQWNjZXNzaWJpbGl0eU9iamVjdDo6dXBkYXRlQmFja2luZ1N0b3JlKCkKIHsK
ICAgICAvLyBVcGRhdGluZyB0aGUgbGF5b3V0IG1heSBkZWxldGUgdGhpcyBvYmplY3QuCi0gICAg
aWYgKERvY3VtZW50KiBkb2N1bWVudCA9IHRoaXMtPmRvY3VtZW50KCkpCi0gICAgICAgIGRvY3Vt
ZW50LT51cGRhdGVMYXlvdXRJZ25vcmVQZW5kaW5nU3R5bGVzaGVldHMoKTsKKyAgICBpZiAoRG9j
dW1lbnQqIGRvY3VtZW50ID0gdGhpcy0+ZG9jdW1lbnQoKSkgeworICAgICAgICBpZiAoIWRvY3Vt
ZW50LT52aWV3KCktPmlzSW5MYXlvdXQoKSkKKyAgICAgICAgICAgIGRvY3VtZW50LT51cGRhdGVM
YXlvdXRJZ25vcmVQZW5kaW5nU3R5bGVzaGVldHMoKTsKKyAgICB9CiAgICAgCiAgICAgdXBkYXRl
Q2hpbGRyZW5JZk5lY2Vzc2FyeSgpOwogfQo=
</data>
<flag name="review"
          id="257492"
          type_id="1"
          status="+"
          setter="enrica"
    />
          </attachment>
      

    </bug>

</bugzilla>