<?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>222879</bug_id>
          
          <creation_ts>2021-03-07 00:57:48 -0800</creation_ts>
          <short_desc>[GPU Process] RemoteImageBufferProxy should not call flushDrawingContext() in its destructor</short_desc>
          <delta_ts>2021-03-12 10:59:07 -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>Canvas</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>222960</dup_id>
          
          <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>222835</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1736907</commentid>
    <comment_count>0</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2021-03-07 00:57:48 -0800</bug_when>
    <thetext>This was done mainly to restore the GraphicsContext of RemoteImageBuffer to its clean state before releasing it. However this may lead to the following crash:

0   com.apple.WebKit              	0x000000010124d7a3 WTFCrashWithInfo(int, char const*, char const*, int) + 19
1   com.apple.WebKit              	0x0000000101745c5d WebKit::WebProcess::ensureGPUProcessConnection() + 683
2   com.apple.WebKit              	0x0000000101763df5 WebKit::RemoteRenderingBackendProxy::messageSenderConnection() const + 17
3   com.apple.WebKit              	0x0000000101280fd5 IPC::MessageSender::sendMessage(std::__1::unique_ptr&lt;IPC::Encoder, std::__1::default_delete&lt;IPC::Encoder&gt; &gt;, WTF::OptionSet&lt;IPC::SendOption&gt;, WTF::Optional&lt;std::__1::pair&lt;WTF::CompletionHandler&lt;void (IPC::Decoder*)&gt;, unsigned long long&gt; &gt;&amp;&amp;) + 29
4   com.apple.WebKit              	0x00000001017b0276 bool IPC::MessageSender::send&lt;Messages::RemoteRenderingBackend::WakeUpAndApplyDisplayList&gt;(Messages::RemoteRenderingBackend::WakeUpAndApplyDisplayList const&amp;, unsigned long long, WTF::OptionSet&lt;IPC::SendOption&gt;) + 106
5   com.apple.WebKit              	0x00000001017642da WebKit::RemoteRenderingBackendProxy::sendDeferredWakeupMessageIfNeeded() + 110
6   com.apple.WebKit              	0x00000001017a9781 WebKit::RemoteImageBufferProxy&lt;WebKit::ImageBufferShareableMappedIOSurfaceBackend&gt;::flushDrawingContextAsync() + 133
7   com.apple.WebKit              	0x00000001017a96e6 WebKit::RemoteImageBufferProxy&lt;WebKit::ImageBufferShareableMappedIOSurfaceBackend&gt;::flushDrawingContext() + 34
8   com.apple.WebKit              	0x00000001017aa41e WebKit::RemoteImageBufferProxy&lt;WebKit::ImageBufferShareableMappedIOSurfaceBackend&gt;::~RemoteImageBufferProxy() + 82
9   com.apple.WebKit              	0x00000001017a95f0 WebKit::RemoteImageBufferProxy&lt;WebKit::ImageBufferShareableMappedIOSurfaceBackend&gt;::~RemoteImageBufferProxy() + 14

This blocks enabling GPU Process for 2D canvas for web-platform-tests/html/canvas/element/line-styles/2d.line.cap.butt.html.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1736908</commentid>
    <comment_count>1</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2021-03-07 00:58:53 -0800</bug_when>
    <thetext>&lt;rdar://problem/73610005&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1738960</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2021-03-12 10:59:07 -0800</bug_when>
    <thetext>This crash was happening because ImageBitmap was destroying its RemoteImageBufferProxy in a worker thread. We have to send at least a message from the WebP to the GPUP to destroy the corresponding RemoteImageBuffer. But this should happen in the main thread only. This is already fixed in r274164.

*** This bug has been marked as a duplicate of bug 222960 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>