<?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>282084</bug_id>
          
          <creation_ts>2024-10-24 23:36:12 -0700</creation_ts>
          <short_desc>[GTK][WPE][Skia] Fix threading issue with DisplayList rendering / GraphicsContextState merging</short_desc>
          <delta_ts>2024-11-18 12:34:15 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>
          
          <blocked>279618</blocked>
    
    <blocked>280677</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolas Zimmermann">zimmermann</reporter>
          <assigned_to name="Nikolas Zimmermann">zimmermann</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2070512</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-10-24 23:36:12 -0700</bug_when>
    <thetext>ASSERTION FAILED: Unsafe to ref/deref from different threads
m_isOwnedByMainThread == isMainThread()
/host/home/nzimmermann/Software/GitRepositories/WebKit/WebKitBuild/WPE/Release/WTF/Headers/wtf/RefCounted.h(124) : void WTF::RefCountedBase::applyRefDerefThreadingCheck() const
1   0x7243c5527d4d WTF::RefCountedBase::ref() const
2   0x7243ca63f6e0 auto std::__detail::__variant::_Copy_assign_base&lt;false, std::monostate, WebCore::SourceBrushLogicalGradient, WTF::Ref&lt;WebCore::Pattern, WTF::RawPtrTraits&lt;WebCore::Pattern&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::Pattern&gt; &gt; &gt;::operator=(std::__detail::__variant::_Copy_assign_base&lt;false, std::monostate, WebCore::SourceBrushLogicalGradient, WTF::Ref&lt;WebCore::Pattern, WTF::RawPtrTraits&lt;WebCore::Pattern&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::Pattern&gt; &gt; &gt; const&amp;)::{lambda(auto:1&amp;&amp;, auto:2)#1}::operator()&lt;WTF::Ref&lt;WebCore::Pattern, WTF::RawPtrTraits&lt;WebCore::Pattern&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::Pattern&gt; &gt; const&amp;, std::integral_constant&lt;unsigned long, 2ul&gt; &gt;(WTF::Ref&lt;WebCore::Pattern, WTF::RawPtrTraits&lt;WebCore::Pattern&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::Pattern&gt; &gt; const&amp;, std::integral_constant&lt;unsigned long, 2ul&gt;)
3   0x7243ca6427ff auto WebCore::GraphicsContextState::mergeLastChanges(WebCore::GraphicsContextState const&amp;, std::optional&lt;WebCore::GraphicsContextState&gt; const&amp;)::$_0::operator()&lt;WebCore::SourceBrush&gt;(WebCore::SourceBrush WebCore::GraphicsContextState::*) const
4   0x7243ca641e1c WebCore::GraphicsContextState::mergeLastChanges(WebCore::GraphicsContextState const&amp;, std::optional&lt;WebCore::GraphicsContextState&gt; const&amp;)
5   0x7243ca6390e3 WebCore::GraphicsContext::mergeLastChanges(WebCore::GraphicsContextState const&amp;, std::optional&lt;WebCore::GraphicsContextState&gt; const&amp;)
6   0x7243ca6c29e2 WebCore::DisplayList::SetState::apply(WebCore::GraphicsContext&amp;) const
7   0x7243ca6bc80b _ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFNS0_21__deduce_visit_resultIN7WebCore11DisplayList15ApplyItemResultEEEON3WTF7VisitorIZNS5_9applyItemERNS4_15GraphicsContextERKNS5_12ResourceHeapERNS4_14ControlFactoryERKSt7variantIJNS5_22ApplyDeviceScaleFactorENS5_22BeginTransparencyLayerENS5_39BeginTransparencyLayerWithCompositeModeENS5_9ClearRectENS5_15ClearDropShadowENS5_4ClipENS5_15ClipRoundedRectENS5_7ClipOutENS5_18ClipOutRoundedRectENS5_13ClipOutToPathENS5_8ClipPathENS5_17ClipToImageBufferENS5_14ConcatenateCTMENS5_15DrawControlPartENS5_25DrawDotsForDocumentMarkerENS5_11DrawEllipseENS5_23DrawFilteredImageBufferENS5_17DrawFocusRingPathENS5_18DrawFocusRingRectsENS5_10DrawGlyphsENS5_20DrawDecomposedGlyphsENS5_20DrawDisplayListItemsENS5_15DrawImageBufferENS5_8DrawLineENS5_16DrawLinesForTextENS5_15DrawNativeImageENS5_8DrawPathENS5_11DrawPatternENS5_8DrawRectENS5_15DrawSystemImageENS5_20EndTransparencyLayerENS5_18FillCompositedRectENS5_11FillEllipseENS5_15FillPathSegmentENS5_8FillPathENS5_8FillRectENS5_17FillRectWithColorENS5_20FillRectWithGradientENS5_37FillRectWithGradientAndSpaceTransformENS5_23FillRectWithRoundedHoleENS5_15FillRoundedRectENS5_9ResetClipENS5_7RestoreENS5_6RotateENS5_4SaveENS5_5ScaleENS5_6SetCTMENS5_18SetInlineFillColorENS5_15SetInlineStrokeENS5_10SetLineCapENS5_11SetLineDashENS5_11SetLineJoinENS5_13SetMiterLimitENS5_8SetStateENS5_13StrokeEllipseENS5_10StrokeLineENS5_17StrokePathSegmentENS5_10StrokePathENS5_10StrokeRectENS5_9TranslateEEEE3$_0JZNS5_9applyItemESB_SE_SG_S28_E3$_1ZNS5_9applyItemESB_SE_SG_S28_E3$_2ZNS5_9applyItemESB_SE_SG_S28_E3$_3ZNS5_9applyItemESB_SE_SG_S28_E3$_4ZNS5_9applyItemESB_SE_SG_S28_E3$_5ZNS5_9applyItemESB_SE_SG_S28_E3$_6ZNS5_9applyItemESB_SE_SG_S28_E3$_7ZNS5_9applyItemESB_SE_SG_S28_E3$_8ZNS5_9applyItemESB_SE_SG_S28_E3$_9ZNS5_9applyItemESB_SE_SG_S28_E4$_10EEES28_EJEEESt16integer_sequenceImJLm53EEEE14__visit_invokeES2L_S28_</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070513</commentid>
    <comment_count>1</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-10-24 23:48:25 -0700</bug_when>
    <thetext>Pattern is not thread-safe.

```
frame #3: 0x00007a4feae3f6e0 libWPEWebKit-2.0.so.2`auto std::__detail::__variant::_Copy_assign_base&lt;false, std::monostate, WebCore::SourceBrushLogicalGradient, WTF::Ref&lt;WebCore::Pattern, WTF::RawPtrTraits&lt;WebCore::Pattern&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::Pattern&gt;&gt;&gt;::operator=(std::__detail::__variant::_Copy_assign_base&lt;false, std::monostate, WebCore::SourceBrushLogicalGradient, WTF::Ref&lt;WebCore::Pattern, WTF::RawPtrTraits&lt;WebCore::Pattern&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::Pattern&gt;&gt;&gt; const&amp;)::&apos;lambda&apos;(auto&amp;&amp;, auto)::operator()&lt;WTF::Ref&lt;WebCore::Pattern, WTF::RawPtrTraits&lt;WebCore::Pattern&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::Pattern&gt;&gt; const&amp;, std::integral_constant&lt;unsigned long, 2ul&gt;&gt;(auto&amp;&amp;, auto) [inlined] WTF::DefaultRefDerefTraits&lt;WebCore::Pattern&gt;::ref(ref=0x00007a4fcf031f80) at Ref.h:55:13
   52  	
   53  	    static ALWAYS_INLINE T&amp; ref(T&amp; ref)
   54  	    {
-&gt; 55  	        ref.ref();
   56  	        return ref;
   57  	    }
   58  	
(lldb) p ref
(WebCore::Pattern &amp;) 0x00007a4fcf031f80: {
  WTF::RefCounted&lt;WebCore::Pattern&gt; = {
    WTF::RefCountedBase = {
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075760</commentid>
    <comment_count>2</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-11-18 00:36:58 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/36787</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075905</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-11-18 12:33:57 -0800</bug_when>
    <thetext>Committed 286744@main (b4d253a7cf35): &lt;https://commits.webkit.org/286744@main&gt;

Reviewed commits have been landed. Closing PR #36787 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075906</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-11-18 12:34:15 -0800</bug_when>
    <thetext>&lt;rdar://problem/140144560&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>