Bug 140470 - Web pages fail to load using public iOS WebKit; ASSERT(!isMainThread()) in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]
Summary: Web pages fail to load using public iOS WebKit; ASSERT(!isMainThread()) in -[...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad iOS 8.1
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-14 15:16 PST by Daniel Bates
Modified: 2015-01-16 16:12 PST (History)
3 users (show)

See Also:


Attachments
Backtrace (7.14 KB, text/plain)
2015-01-14 15:16 PST, Daniel Bates
no flags Details
Patch (4.31 KB, patch)
2015-01-16 16:00 PST, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2015-01-14 15:16:19 PST
Created attachment 244648 [details]
Backtrace

When I load apple.com in the iOS Simulator using a debug build of iOS WebKit built with the public iOS SDK the assertion ASSERT(!isMainThread()) fails in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:].

I'm using OpenSource r178229 and the public iOS 8.1 SDK with Xcode Version 6.1.1 (6A2008a) on OS X 10.10.1 (14B25).
Comment 1 Pratik Solanki 2015-01-14 15:28:27 PST
Does this get fixed if you comment out the following line?

    CFURLRequestSetShouldStartSynchronously(request, 1);

in ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp
Comment 2 Daniel Bates 2015-01-16 16:00:09 PST
Created attachment 244815 [details]
Patch
Comment 3 Daniel Bates 2015-01-16 16:06:29 PST
(In reply to comment #1)
> Does this get fixed if you comment out the following line?
> 
>     CFURLRequestSetShouldStartSynchronously(request, 1);
> 
> in ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp

No, the issue reproduced even after commenting out the analogous line in ResourceHandleMac.mm: <http://trac.webkit.org/browser/trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm?rev=176949#L222>.
Comment 4 Daniel Bates 2015-01-16 16:10:22 PST
Pratik and I looked at this issue together today (01/16). Pratik noticed that we were incorrectly scheduling the NSURLConnection callbacks in WebKit2 with the NetworkProcess. Looking at this case, we want to schedule such callbacks to an NSOperationsQueue queue when using WebKit2 with the NetworkProcess.
Comment 5 Daniel Bates 2015-01-16 16:12:46 PST
Comment on attachment 244815 [details]
Patch

Clearing flags on attachment: 244815

Committed r178612: <http://trac.webkit.org/changeset/178612>
Comment 6 Daniel Bates 2015-01-16 16:12:50 PST
All reviewed patches have been landed.  Closing bug.