WKWebView process terminates in CI but not locally

656 Views Asked by At

WKWebView content processes are crashing 100% of the time when I load pages in unit tests.

They run correctly on my development computer, but WKWebView keeps calling webViewWebContentProcessDidTerminate: when I run the tests in continuous integration. This leads to a test failure. Here's the output from CI:

Child process terminated with signal 11: Segmentation fault
Test crashed while running.
CRASH REPORT: xctest_2019-12-09-141138_pb74.crash
Process:               xctest [11083]
Path:                  /Applications/Xcode10.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest
Identifier:            xctest
Version:               14490.71
Code Type:             X86-64 (Native)
Parent Process:        ??? [11077]
Responsible:           xctest [11083]
User ID:               503
Date/Time:             2019-12-09 14:11:37.719 -0800
OS Version:            Mac OS X 10.14.4 (18E226)
Report Version:        12
Anonymous UUID:        24ECA480-650F-8C0B-AE5B-4D2E3666588E
Time Awake Since Boot: 290000 seconds
System Integrity Protection: disabled
Crashed Thread:        0  Dispatch queue: com.apple.main-thread
Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY
Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [11083]
VM Regions Near 0:
--> 
__TEXT                 00000001067ea000-00000001067f0000 [   24K] r-x/rwx SM=COW  /Applications/Xcode10.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest
Application Specific Information:
CoreSimulator 587.35 - Device: iPhone 8 (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) - Runtime: iOS 12.2 (16E226) - DeviceType: iPhone 8
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.WebKit                0x000000011f852f0b WebKit::WebProcessPool::networkProcessCrashed(WebKit::NetworkProcessProxy&, WTF::Vector<std::__1::pair<WTF::RefPtr<WebKit::WebProcessProxy, WTF::DumbPtrTraits<WebKit::WebProcessProxy> >, WTF::CompletionHandler<void (IPC::Attachment const&)> >, 0ul, WTF::CrashOnOverflow, 16ul>&&) + 89
1   com.apple.WebKit                0x000000011f8fc913 WebKit::NetworkProcessProxy::networkProcessCrashed() + 447
2   com.apple.WebKit                0x000000011f8fd604 WebKit::NetworkProcessProxy::didFinishLaunching(WebKit::ProcessLauncher*, IPC::Connection::Identifier) + 352
3   com.apple.WebKit                0x000000011f6b99e5 WebKit::ProcessLauncher::didFinishLaunchingProcess(int, IPC::Connection::Identifier) + 101
4   com.apple.WebKit                0x000000011f80db30 WTF::Function<void ()>::CallableWrapper<WebKit::ProcessLauncher::launchProcess()::$_2::operator()(NSObject<OS_xpc_object>*)::'lambda'()>::call() + 148
5   com.apple.JavaScriptCore        0x00000001121bb1f4 WTF::RunLoop::performWork() + 228
6   com.apple.JavaScriptCore        0x00000001121bb482 WTF::RunLoop::performWork(void*) + 34
7   com.apple.CoreFoundation        0x0000000107a60be1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
8   com.apple.CoreFoundation        0x0000000107a60463 __CFRunLoopDoSources0 + 243
9   com.apple.CoreFoundation        0x0000000107a5ab1f __CFRunLoopRun + 1231
10  com.apple.CoreFoundation        0x0000000107a5a302 CFRunLoopRunSpecific + 626
11  com.apple.dt.XCTest             0x0000000106f81f24 -[XCTWaiter waitForExpectations:timeout:enforceOrder:] + 996
12  com.apple.dt.XCTest             0x0000000106f1beb2 -[XCTestCase(AsynchronousTesting) waitForExpectations:timeout:enforceOrder:] + 113
13  com.MyStupidApp.MyStupidFramework   0x000000011f06f391 -[MyStupidTestCase _loadSomeURL] + 369
...

I'm using Buck to build, and running unit tests with buck test both locally and in CI.

As far as I can tell, the biggest differences between my machine and the CI machine are:

  1. Xcode 10.2 for CI, Xcode 10.3 on my computer
  2. CI runs many more unit tests than just mine, so there could be spillover from other test suites.

I'm working on resolving those differences now. But what kinds of things might be causing WKWebView's content process to crash on CI, while working properly on my computer?

Thanks!

0

There are 0 best solutions below