<?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>168292</bug_id>
          
          <creation_ts>2017-02-14 00:11:09 -0800</creation_ts>
          <short_desc>REGRESSION(r212239): Crash in DragImage::operator=(WebCore::DragImage&amp;&amp;) when DragImageRef is the same</short_desc>
          <delta_ts>2017-02-14 22:52:20 -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>Platform</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=168131</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>LayoutTestFailure, Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>bdakin</cc>
    
    <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1276632</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-02-14 00:11:09 -0800</bug_when>
    <thetext>This happens at least in the GTK+ port where DragImageRef is a pointer (we should definitely change that). It caused several crashes in the bots:

Thread 1 (Thread 0x2b4ba8e96940 (LWP 11637)):
#0  0x00002b4ba28b3067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00002b4ba28b4448 in __GI_abort () at abort.c:89
#2  0x00002b4ba28ac266 in __assert_fail_base (fmt=0x2b4ba29e5238 &quot;%s%s%s:%u: %s%sAssertion `%s&apos; failed.\n%n&quot;, assertion=assertion@entry=0x2b4b9ba8ce08 &quot;((*&amp;(&amp;surface-&gt;ref_count)-&gt;ref_count) &gt; 0)&quot;, file=file@entry=0x2b4b9ba8cd38 &quot;/home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/cairo-1.14.2/src/cairo-surface.c&quot;, line=line@entry=953, function=function@entry=0x2b4b9ba9d9f0 &lt;__PRETTY_FUNCTION__.11168&gt; &quot;cairo_surface_destroy&quot;) at assert.c:92
#3  0x00002b4ba28ac312 in __GI___assert_fail (assertion=0x2b4b9ba8ce08 &quot;((*&amp;(&amp;surface-&gt;ref_count)-&gt;ref_count) &gt; 0)&quot;, file=0x2b4b9ba8cd38 &quot;/home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/cairo-1.14.2/src/cairo-surface.c&quot;, line=953, function=0x2b4b9ba9d9f0 &lt;__PRETTY_FUNCTION__.11168&gt; &quot;cairo_surface_destroy&quot;) at assert.c:101
#4  0x00002b4b9ba1a7c2 in cairo_surface_destroy () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/cairo-1.14.2/src/cairo-surface.c:953
#5  0x00002b4b9968b7f9 in WebCore::DragImage::operator=(WebCore::DragImage&amp;&amp;) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#6  0x00002b4b995d7e8b in WebCore::DragController::doImageDrag(WebCore::Element&amp;, WebCore::IntPoint const&amp;, WebCore::IntRect const&amp;, WebCore::DataTransfer&amp;, WebCore::Frame&amp;, WebCore::IntPoint&amp;) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#7  0x00002b4b995dbcc2 in WebCore::DragController::startDrag(WebCore::Frame&amp;, WebCore::DragState const&amp;, WebCore::DragOperation, WebCore::PlatformMouseEvent const&amp;, WebCore::IntPoint const&amp;) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#8  0x00002b4b995e3994 in WebCore::EventHandler::handleDrag(WebCore::MouseEventWithHitTestResults const&amp;, WebCore::CheckDragHysteresis) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#9  0x00002b4b995e3eb8 in WebCore::EventHandler::handleMouseDraggedEvent(WebCore::MouseEventWithHitTestResults const&amp;, WebCore::CheckDragHysteresis) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#10 0x00002b4b995eab67 in WebCore::EventHandler::handleMouseMoveEvent(WebCore::PlatformMouseEvent const&amp;, WebCore::HitTestResult*, bool) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37

When m_dragImageRef is the same as other.m_dragImageRef we end up deleting twice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1276634</commentid>
    <comment_count>1</comment_count>
      <attachid>301472</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-02-14 00:14:30 -0800</bug_when>
    <thetext>Created attachment 301472
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1276800</commentid>
    <comment_count>2</comment_count>
      <attachid>301472</attachid>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2017-02-14 10:06:02 -0800</bug_when>
    <thetext>Comment on attachment 301472
Patch

This isn&apos;t right. Just self-move a no-op.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277074</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-02-14 22:52:20 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Comment on attachment 301472 [details]
&gt; Patch
&gt; 
&gt; This isn&apos;t right. Just self-move a no-op.

I&apos;m not sure this is actually a self-move, this and other are not the same but both wrap the same pointer. This is no longer a problem for us, though, because I changed our DragImageRef to be a RefPtr too, and I don&apos;t think there are any other ports using raw pointers now.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>301472</attachid>
            <date>2017-02-14 00:14:30 -0800</date>
            <delta_ts>2017-02-14 10:06:02 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>wk-drag-crash.diff</filename>
            <type>text/plain</type>
            <size>1377</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCA4ZTU1NzMwOWUyYi4uNDMyMTk1MTNjYTkgMTAwNjQ0Ci0tLSBhL1NvdXJj
ZS9XZWJDb3JlL0NoYW5nZUxvZworKysgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxNyBAQAorMjAxNy0wMi0xNCAgQ2FybG9zIEdhcmNpYSBDYW1wb3MgIDxjZ2FyY2lhQGln
YWxpYS5jb20+CisKKyAgICAgICAgUkVHUkVTU0lPTihyMjEyMjM5KTogQ3Jhc2ggaW4gRHJhZ0lt
YWdlOjpvcGVyYXRvcj0oV2ViQ29yZTo6RHJhZ0ltYWdlJiYpIHdoZW4gRHJhZ0ltYWdlUmVmIGlz
IHRoZSBzYW1lCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9p
ZD0xNjgyOTIKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAg
ICBXaGVuIG1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X2Ry
YWdJbWFnZVJlZiA9IG51bGxwdHI7CisgICAgICAgIHJldHVybiAqdGhpczsKKyAgICB9CisKICAg
ICBpZiAobV9kcmFnSW1hZ2VSZWYpCiAgICAgICAgIGRlbGV0ZURyYWdJbWFnZShtX2RyYWdJbWFn
ZVJlZik7CiAK
</data>
<flag name="review"
          id="323279"
          type_id="1"
          status="-"
          setter="andersca"
    />
          </attachment>
      

    </bug>

</bugzilla>