Bug 149766

Summary: DumpRenderTree built with public iOS SDK crashes under -[WebPreferences(WebPrivate) _setCurrentNetworkLoaderSessionCookieAcceptPolicy:]
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, buildbot, ddkilzer, rniwa
Priority: P2    
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 9.0   
Attachments:
Description Flags
Crash Report
none
Patch
none
Archive of layout-test-results from ews100 for mac-mavericks
none
Patch ap: review+

Description Daniel Bates 2015-10-02 15:21:06 PDT
Created attachment 262356 [details]
Crash Report

Many tests crash on the Apple iOS 9 Simulator Release WK1 (Tests) with the following backtrace:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.CFNetwork           	0x0000000108429cab HTTPCookieStorage::setAcceptPolicy(int) + 17
1   com.apple.WebKitLegacy        	0x0000000112cfebc5 +[WebPreferences(WebPrivate) _setCurrentNetworkLoaderSessionCookieAcceptPolicy:] + 37
2   ???                           	0x0000000107ebba90 0 + 4427856528
3   ???                           	0x0000000107eb9142 0 + 4427845954
4   ???                           	0x0000000107eb8d84 0 + 4427844996
5   com.apple.Foundation          	0x0000000108eaa607 __NSThreadPerformPerform + 283
6   com.apple.CoreFoundation      	0x00000001087cc0a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
7   com.apple.CoreFoundation      	0x00000001087c1f47 __CFRunLoopDoSources0 + 423
8   com.apple.CoreFoundation      	0x00000001087c1483 __CFRunLoopRun + 867
9   com.apple.CoreFoundation      	0x00000001087c0e98 CFRunLoopRunSpecific + 488
10  com.apple.GraphicsServices    	0x00000001092c9ad2 GSEventRunModal + 161
11  com.apple.UIKit               	0x0000000109868676 UIApplicationMain + 171
12  ???                           	0x0000000107eba6a1 0 + 4427851425
13  libdyld.dylib                 	0x000000010f0cd92d start + 1
Comment 1 Daniel Bates 2015-10-02 15:22:23 PDT
Notice that OpenSource iOS WebKit is built without USE(CFNETWORK). When WebKit is built without USE(CFNETWORK) we defer to the shared NSHTTPCookieStorage store for cookies instead of maintaining our own cookie store(s). So, NetworkStorageSession::cookieStorage() always returns a nullptr.
Comment 2 Daniel Bates 2015-10-02 15:27:12 PDT
Created attachment 262357 [details]
Patch
Comment 3 Build Bot 2015-10-02 16:01:11 PDT
Comment on attachment 262357 [details]
Patch

Attachment 262357 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/237939

New failing tests:
http/tests/cookies/third-party-cookie-relaxing.html
http/tests/xmlhttprequest/cross-origin-cookie-storage.html
Comment 4 Build Bot 2015-10-02 16:01:15 PDT
Created attachment 262359 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 5 Daniel Bates 2015-10-02 16:46:43 PDT
Comment on attachment 262357 [details]
Patch

The patch is wrong.
Comment 6 Daniel Bates 2015-10-05 11:23:35 PDT
Created attachment 262450 [details]
Patch

I added an assert in +[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:] to ensure we have a non-null pointer to a cookie store. Let me know if this assert is unnecessary.
Comment 7 Alexey Proskuryakov 2015-10-05 12:28:16 PDT
Comment on attachment 262450 [details]
Patch

EWS is still orange due to an unrelated issue.
Comment 8 Daniel Bates 2015-10-05 13:57:39 PDT
Committed r190578: <http://trac.webkit.org/changeset/190578>