Fix iOS API tests after r196802
Created attachment 270700 [details] Patch
This is the output when I run "run-api-tests -v --ios-simulator WebCoreNSURLSessionTest" without this patch: ASSERTION FAILED: allocator /Volumes/Code/fuji/OpenSource/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp(129) : JSC::ExecutableAllocator::ExecutableAllocator(JSC::VM &) 1 0x10ee3845d WTFCrash 2 0x10e879b72 JSC::ExecutableAllocator::ExecutableAllocator(JSC::VM&) 3 0x10e879b9d JSC::ExecutableAllocator::ExecutableAllocator(JSC::VM&) 4 0x10edc8fc3 JSC::VM::VM(JSC::VM::VMType, JSC::HeapType) 5 0x10edcc841 JSC::VM::VM(JSC::VM::VMType, JSC::HeapType) 6 0x10edcde56 JSC::VM::create(JSC::HeapType) 7 0x10edcde8a JSC::VM::createLeaked(JSC::HeapType) 8 0x113f2788a WebCore::JSDOMWindowBase::commonVM() 9 0x114710ac4 WebCore::PageScriptDebugServer::PageScriptDebugServer(WebCore::Page&) 10 0x114710b1d WebCore::PageScriptDebugServer::PageScriptDebugServer(WebCore::Page&) 11 0x113cb7334 WebCore::InspectorController::InspectorController(WebCore::Page&, WebCore::InspectorClient*) 12 0x113cbcc95 WebCore::InspectorController::InspectorController(WebCore::Page&, WebCore::InspectorClient*) 13 0x1146e3e14 std::_Unique_if<WebCore::InspectorController>::_Single_object std::make_unique<WebCore::InspectorController, WebCore::Page&, WebCore::InspectorClient*&>(WebCore::Page&&&, WebCore::InspectorClient*&&&) 14 0x1146dafaf WebCore::Page::Page(WebCore::PageConfiguration&) 15 0x1146dbced WebCore::Page::Page(WebCore::PageConfiguration&) 16 0x11f952e86 -[WebView(WebPrivate) _commonInitializationWithFrameName:groupName:] 17 0x11f953e49 -[WebView(WebPrivate) _initWithFrame:frameName:groupName:] 18 0x11f96346f -[WebView initWithFrame:frameName:groupName:] 19 0x11f9633ca -[WebView initWithFrame:] 20 0x10dde1a10 TestWebKitAPI::WebCoreNSURLSessionTest::SetUp() 21 0x10ddfd46e testing::Test::Run() 22 0x10ddfdd7d testing::internal::TestInfoImpl::Run() 23 0x10ddfe8bd testing::TestCase::Run() 24 0x10de046bb testing::internal::UnitTestImpl::RunAllTests() 25 0x10de04339 testing::UnitTest::Run() 26 0x10dd6e4cc TestWebKitAPI::TestsController::run(int, char**) 27 0x10ddc3b65 main 28 0x11cbb78d1 start 29 0x2 Child process terminated with signal 11: Segmentation fault ASSERTION FAILED: allocator /Volumes/Code/fuji/OpenSource/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp(129) : JSC::ExecutableAllocator::ExecutableAllocator(JSC::VM &) 1 0x1086a145d WTFCrash 2 0x1080e2b72 JSC::ExecutableAllocator::ExecutableAllocator(JSC::VM&) 3 0x1080e2b9d JSC::ExecutableAllocator::ExecutableAllocator(JSC::VM&) 4 0x108631fc3 JSC::VM::VM(JSC::VM::VMType, JSC::HeapType) 5 0x108635841 JSC::VM::VM(JSC::VM::VMType, JSC::HeapType) 6 0x108636e56 JSC::VM::create(JSC::HeapType) 7 0x108636e8a JSC::VM::createLeaked(JSC::HeapType) 8 0x10d79088a WebCore::JSDOMWindowBase::commonVM() 9 0x10df79ac4 WebCore::PageScriptDebugServer::PageScriptDebugServer(WebCore::Page&) 10 0x10df79b1d WebCore::PageScriptDebugServer::PageScriptDebugServer(WebCore::Page&) 11 0x10d520334 WebCore::InspectorController::InspectorController(WebCore::Page&, WebCore::InspectorClient*) 12 0x10d525c95 WebCore::InspectorController::InspectorController(WebCore::Page&, WebCore::InspectorClient*) 13 0x10df4ce14 std::_Unique_if<WebCore::InspectorController>::_Single_object std::make_unique<WebCore::InspectorController, WebCore::Page&, WebCore::InspectorClient*&>(WebCore::Page&&&, WebCore::InspectorClient*&&&) 14 0x10df43faf WebCore::Page::Page(WebCore::PageConfiguration&) 15 0x10df44ced WebCore::Page::Page(WebCore::PageConfiguration&) 16 0x1191bbe86 -[WebView(WebPrivate) _commonInitializationWithFrameName:groupName:] 17 0x1191bce49 -[WebView(WebPrivate) _initWithFrame:frameName:groupName:] 18 0x1191cc46f -[WebView initWithFrame:frameName:groupName:] 19 0x1191cc3ca -[WebView initWithFrame:] 20 0x10764aa10 TestWebKitAPI::WebCoreNSURLSessionTest::SetUp() 21 0x10766646e testing::Test::Run() 22 0x107666d7d testing::internal::TestInfoImpl::Run() 23 0x1076678bd testing::TestCase::Run() 24 0x10766d6bb testing::internal::UnitTestImpl::RunAllTests() 25 0x10766d339 testing::UnitTest::Run() 26 0x1075d74cc TestWebKitAPI::TestsController::run(int, char**) 27 0x10762cb65 main 28 0x1164208d1 start 29 0x2
Comment on attachment 270700 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=270700&action=review > Tools/TestWebKitAPI/Tests/WebCore/WebCoreNSURLSession.mm:115 > + WTF::initializeMainThread(); > + JSC::initializeThreading(); > + RunLoop::initializeMainRunLoop(); > view = [[WebView alloc] initWithFrame:NSZeroRect]; Why does this not happen automatically? I thought that WebView class instantiation was supposed to do this.
I don't know, but this fixes the test all the time.
Created attachment 270703 [details] Patch
This solves it, too. There are lots of places where we have !PLATFORM(IOS) protections around initializeThreading calls, and I don't know why.
Perhaps Dan or David remember why?
Created attachment 270766 [details] Patch
This is instead of https://bugs.webkit.org/show_bug.cgi?id=153885
*** Bug 153885 has been marked as a duplicate of this bug. ***
Comment on attachment 270766 [details] Patch Clearing flags on attachment: 270766 Committed r196189: <http://trac.webkit.org/changeset/196189>
All reviewed patches have been landed. Closing bug.