<?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>253543</bug_id>
          
          <creation_ts>2023-03-07 16:34:12 -0800</creation_ts>
          <short_desc>[UI-side compositing] Crash in displaylink::addObserver()</short_desc>
          <delta_ts>2023-04-21 11:55:02 -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>WebKit Process Model</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=255800</see_also>
          <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="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Simon Fraser (smfr)">simon.fraser</assigned_to>
          <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1939588</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2023-03-07 16:34:12 -0800</bug_when>
    <thetext>If you close a window soon after a scroll gesture, you can hit this crash:

#0	0x0000000115512f84 in unsigned int std::__1::__cxx_atomic_fetch_add[abi:v15006]&lt;unsigned int&gt;(std::__1::__cxx_atomic_base_impl&lt;unsigned int&gt;*, unsigned int, std::__1::memory_order) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/atomic:1009
#1	0x00000001154c5bec in std::__1::__atomic_base&lt;unsigned int, true&gt;::fetch_add[abi:v15006](unsigned int, std::__1::memory_order) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/atomic:1659
#2	0x0000000115a41774 in std::__1::__atomic_base&lt;unsigned int, true&gt;::operator++[abi:v15006]() at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/atomic:1696
#3	0x0000000116eea7f0 in WTF::CanMakeCheckedPtrBase&lt;std::__1::atomic&lt;unsigned int&gt;, unsigned int&gt;::incrementPtrCount() const at /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/CheckedRef.h:233
#4	0x0000000116eea7c4 in WTF::CheckedRef&lt;WebKit::DisplayLink::Client, WTF::RawPtrTraits&lt;WebKit::DisplayLink::Client&gt; &gt;::CheckedRef(WebKit::DisplayLink::Client&amp;) at /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/CheckedRef.h:54
#5	0x0000000116e91dd0 in WTF::CheckedRef&lt;WebKit::DisplayLink::Client, WTF::RawPtrTraits&lt;WebKit::DisplayLink::Client&gt; &gt;::CheckedRef(WebKit::DisplayLink::Client&amp;) at /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/CheckedRef.h:53
#6	0x0000000116e91b20 in WebKit::DisplayLink::addObserver(WebKit::DisplayLink::Client&amp;, WTF::ObjectIdentifier&lt;WebKit::DisplayLinkObserverIDType&gt;, unsigned int) at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/mac/DisplayLink.cpp:97
#7	0x0000000116e2b79c in WebKit::RemoteLayerTreeEventDispatcher::startDisplayLinkObserver() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:310
#8	0x0000000116e2b4c0 in WebKit::RemoteLayerTreeEventDispatcher::startOrStopDisplayLinkOnMainThread() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:292
#9	0x0000000116e2a358 in WebKit::RemoteLayerTreeEventDispatcher::startOrStopDisplayLink() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:266
#10	0x0000000116e2bc20 in WebKit::RemoteLayerTreeEventDispatcher::stopDisplayDidRefreshCallbacks(unsigned int) at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:383
#11	0x00000001174f6fd0 in WebKit::MomentumEventDispatcher::stopDisplayLink() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp:306
#12	0x00000001174f6e48 in WebKit::MomentumEventDispatcher::~MomentumEventDispatcher() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp:49
#13	0x00000001174f70e4 in WebKit::MomentumEventDispatcher::~MomentumEventDispatcher() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp:48
#14	0x0000000116e4114c in std::__1::default_delete&lt;WebKit::MomentumEventDispatcher&gt;::operator()[abi:v15006](WebKit::MomentumEventDispatcher*) const at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/__memory/unique_ptr.h:48
#15	0x0000000116e410b4 in std::__1::unique_ptr&lt;WebKit::MomentumEventDispatcher, std::__1::default_delete&lt;WebKit::MomentumEventDispatcher&gt; &gt;::reset[abi:v15006](WebKit::MomentumEventDispatcher*) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/__memory/unique_ptr.h:305
#16	0x0000000116e41038 in std::__1::unique_ptr&lt;WebKit::MomentumEventDispatcher, std::__1::default_delete&lt;WebKit::MomentumEventDispatcher&gt; &gt;::~unique_ptr[abi:v15006]() at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/__memory/unique_ptr.h:259
#17	0x0000000116e29ccc in std::__1::unique_ptr&lt;WebKit::MomentumEventDispatcher, std::__1::default_delete&lt;WebKit::MomentumEventDispatcher&gt; &gt;::~unique_ptr[abi:v15006]() at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/__memory/unique_ptr.h:259
#18	0x0000000116e29c40 in WebKit::RemoteLayerTreeEventDispatcher::~RemoteLayerTreeEventDispatcher() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:104
#19	0x0000000116e29e00 in WebKit::RemoteLayerTreeEventDispatcher::~RemoteLayerTreeEventDispatcher() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:104
#20	0x0000000116e29e30 in WebKit::RemoteLayerTreeEventDispatcher::~RemoteLayerTreeEventDispatcher() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:104
#21	0x0000000116698514 in WTF::ThreadSafeRefCounted&lt;WebKit::RemoteLayerTreeEventDispatcher, (WTF::DestructionThread)0&gt;::deref() const::&apos;lambda&apos;()::operator()() const at /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/ThreadSafeRefCounted.h:115
#22	0x0000000116698470 in WTF::ThreadSafeRefCounted&lt;WebKit::RemoteLayerTreeEventDispatcher, (WTF::DestructionThread)0&gt;::deref() const at /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/ThreadSafeRefCounted.h:127
#23	0x000000011669867c in WTF::DefaultRefDerefTraits&lt;WebKit::RemoteLayerTreeEventDispatcher&gt;::derefIfNotNull(WebKit::RemoteLayerTreeEventDispatcher*) at /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/RefPtr.h:42
#24	0x0000000116698638 in WTF::RefPtr&lt;WebKit::RemoteLayerTreeEventDispatcher, WTF::RawPtrTraits&lt;WebKit::RemoteLayerTreeEventDispatcher&gt;, WTF::DefaultRefDerefTraits&lt;WebKit::RemoteLayerTreeEventDispatcher&gt; &gt;::~RefPtr() at /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/RefPtr.h:74
#25	0x000000011667d52c in WTF::RefPtr&lt;WebKit::RemoteLayerTreeEventDispatcher, WTF::RawPtrTraits&lt;WebKit::RemoteLayerTreeEventDispatcher&gt;, WTF::DefaultRefDerefTraits&lt;WebKit::RemoteLayerTreeEventDispatcher&gt; &gt;::~RefPtr() at /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/RefPtr.h:74
#26	0x000000011667d5b8 in WebKit::RemoteScrollingCoordinatorProxyMac::~RemoteScrollingCoordinatorProxyMac() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.mm:62
#27	0x000000011667d61c in WebKit::RemoteScrollingCoordinatorProxyMac::~RemoteScrollingCoordinatorProxyMac() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.mm:58
#28	0x000000011667d64c in WebKit::RemoteScrollingCoordinatorProxyMac::~RemoteScrollingCoordinatorProxyMac() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.mm:58
#29	0x0000000116b27d1c in std::__1::default_delete&lt;WebKit::RemoteScrollingCoordinatorProxy&gt;::operator()[abi:v15006](WebKit::RemoteScrollingCoordinatorProxy*) const at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/__memory/unique_ptr.h:48
#30	0x0000000116b27c60 in std::__1::unique_ptr&lt;WebKit::RemoteScrollingCoordinatorProxy, std::__1::default_delete&lt;WebKit::RemoteScrollingCoordinatorProxy&gt; &gt;::reset[abi:v15006](WebKit::RemoteScrollingCoordinatorProxy*) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/__memory/unique_ptr.h:305
#31	0x0000000116aa8944 in std::__1::unique_ptr&lt;WebKit::RemoteScrollingCoordinatorProxy, std::__1::default_delete&lt;WebKit::RemoteScrollingCoordinatorProxy&gt; &gt;::operator=[abi:v15006](std::nullptr_t) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.Internal.sdk/usr/include/c++/v1/__memory/unique_ptr.h:263
#32	0x0000000116aa7518 in WebKit::WebPageProxy::setDrawingArea(std::__1::unique_ptr&lt;WebKit::DrawingAreaProxy, std::__1::default_delete&lt;WebKit::DrawingAreaProxy&gt; &gt;&amp;&amp;) at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/WebPageProxy.cpp:1148
#33	0x0000000116aaa408 in WebKit::WebPageProxy::resetState(WebKit::WebPageProxy::ResetStateReason) at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/WebPageProxy.cpp:8392
#34	0x0000000116aa2798 in WebKit::WebPageProxy::close() at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/WebPageProxy.cpp:1257
#35	0x000000011605038c in -[WKWebView dealloc] at /Volumes/Data/WebKit/OpenSource/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:663</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1939589</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2023-03-07 16:34:31 -0800</bug_when>
    <thetext>&lt;rdar://59960084&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1939594</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2023-03-07 16:47:30 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/11202</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1939967</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-03-08 22:19:42 -0800</bug_when>
    <thetext>Committed 261404@main (355ad2b87eea): &lt;https://commits.webkit.org/261404@main&gt;

Reviewed commits have been landed. Closing PR #11202 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>