iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 09:20:14 +0000 (09:20 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 09:20:14 +0000 (09:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176968
Source/WebKit:

Reviewed by Wenson Hsieh.

Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside
a WebContent process in release builds and an assertion failure in debug builds.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):

LayoutTests:

<rdar://problem/34454843>

Reviewed by Wenson Hsieh.

Unskip the test which used to crash/hit assertions.

* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222080 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/ios/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm

index 23e434e..285d734 100644 (file)
@@ -1,3 +1,15 @@
+2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
+
+        iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html
+        https://bugs.webkit.org/show_bug.cgi?id=176968
+        <rdar://problem/34454843>
+
+        Reviewed by Wenson Hsieh.
+
+        Unskip the test which used to crash/hit assertions.
+
+        * platform/ios/TestExpectations:
+
 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed GTK+ gardening. Rebaseline tests after r222077. Part 2.
index f262723..76b637f 100644 (file)
@@ -2237,8 +2237,8 @@ editing/pasteboard/copy-without-selection.html [ Failure ]
 editing/pasteboard/data-transfer-items.html [ Failure ]
 editing/pasteboard/dataTransfer-setData-getData.html [ Failure ]
 editing/pasteboard/datatransfer-getdata-plaintext.html [ Failure ]
-editing/pasteboard/datatransfer-items-copy-plaintext.html [ Skip ]
-editing/pasteboard/datatransfer-items-paste-plaintext.html [ Skip ]
+editing/pasteboard/datatransfer-items-copy-plaintext.html [ Failure ]
+editing/pasteboard/datatransfer-items-paste-plaintext.html [ Failure ]
 editing/pasteboard/display-block-on-spans.html [ Failure ]
 editing/pasteboard/emacs-ctrl-k-with-move.html [ Failure ]
 editing/pasteboard/emacs-ctrl-k-y-001.html [ Failure ]
index 067d119..e690952 100644 (file)
@@ -1,3 +1,16 @@
+2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
+
+        iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html
+        https://bugs.webkit.org/show_bug.cgi?id=176968
+
+        Reviewed by Wenson Hsieh.
+
+        Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside
+        a WebContent process in release builds and an assertion failure in debug builds.
+
+        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
+        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
+
 2017-09-14  Youenn Fablet  <youenn@apple.com>
 
         Add Cache API support of records persistency
index 51ca16b..411e5bc 100644 (file)
@@ -181,6 +181,8 @@ void WebPasteboardProxy::readBufferFromPasteboard(uint64_t index, const String&
     if (!buffer)
         return;
     size = buffer->size();
+    if (!size)
+        return;
     RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::allocate(size);
     if (!sharedMemoryBuffer)
         return;