Changeset 211734 in webkit
- Timestamp:
- Feb 6, 2017 10:00:52 AM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r211726 r211734 1 2017-02-06 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [Soup] Deadlock in NetworkProcess 4 https://bugs.webkit.org/show_bug.cgi?id=167876 5 6 Reviewed by Michael Catanzaro. 7 8 WebKitSoupRequestInputStream uses a read lock. What is happening is that webkitSoupRequestInputStreamAddData 9 takes the lock, and it calls webkitSoupRequestInputStreamPendingReadAsyncComplete with the lock help. That 10 causes webkitSoupRequestInputStreamReadAsync to be called again to read the next chunk, but in the same run loop 11 operation. We don't really need the read lock because both webkitSoupRequestInputStreamAddData and 12 webkitSoupRequestInputStreamReadAsync shoudl always be called from the main thread. 13 14 * WebProcess/soup/WebKitSoupRequestInputStream.cpp: 15 (webkitSoupRequestInputStreamReadAsync): Remove the read lock and assert if called from a secondary thread. 16 (webkitSoupRequestInputStreamAddData): Ditto. 17 1 18 2017-02-03 Anders Carlsson <andersca@apple.com> 2 19 -
trunk/Source/WebKit2/WebProcess/soup/WebKitSoupRequestInputStream.cpp
r194496 r211734 21 21 #include "WebKitSoupRequestInputStream.h" 22 22 23 #include <wtf/Lock.h> 24 #include <wtf/Threading.h> 23 #include <wtf/MainThread.h> 25 24 #include <wtf/glib/GRefPtr.h> 26 25 #include <wtf/glib/GUniquePtr.h> … … 46 45 GUniquePtr<GError> error; 47 46 48 Lock readLock;49 47 std::unique_ptr<AsyncReadData> pendingAsyncRead; 50 48 }; … … 86 84 static void webkitSoupRequestInputStreamReadAsync(GInputStream* inputStream, void* buffer, gsize count, int /*priority*/, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer userData) 87 85 { 86 ASSERT(isMainThread()); 88 87 WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(inputStream); 89 88 GRefPtr<GTask> task = adoptGRef(g_task_new(stream, cancellable, callback, userData)); 90 91 LockHolder locker(stream->priv->readLock);92 89 93 90 if (!webkitSoupRequestInputStreamHasDataToRead(stream) && !webkitSoupRequestInputStreamIsWaitingForData(stream)) { … … 150 147 void webkitSoupRequestInputStreamAddData(WebKitSoupRequestInputStream* stream, const void* data, size_t dataLength) 151 148 { 149 ASSERT(isMainThread()); 150 152 151 if (webkitSoupRequestInputStreamFinished(stream)) 153 152 return; 154 155 LockHolder locker(stream->priv->readLock);156 153 157 154 if (dataLength) {
Note: See TracChangeset
for help on using the changeset viewer.