8

We have a hybrid iOS app with a UIWebView that loads a fairly complex webshop (bunch of tracking-pixels, javasript, async behaviour). Since the rollout of iOS 11.3 we see a lot of crashes that seem to come from the UIWebView or related components. The stacktrace looks like this

Crashed: WebThread
0  WebCore                        0x18b7b0d98 WebCore::Page::sessionID() const + 162
1  WebKitLegacy                   0x18be91204 WebFrameNetworkingContext::storageSession() const + 24
2  WebCore                        0x18ad818bc WebCore::ResourceHandle::willSendRequest(WebCore::ResourceRequest&&, WebCore::ResourceResponse&&, WTF::CompletionHandler<void (WebCore::ResourceRequest&&)>&&) + 1012
3  WebCore                        0x18ad86f88 WTF::Function<void ()>::CallableWrapper<-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]::$_1>::call() + 208
4  JavaScriptCore                 0x1892157d4 WTF::dispatchFunctionsFromMainThread() + 344
5  Foundation                     0x1830fe0ec __NSThreadPerformPerform + 340
6  CoreFoundation                 0x18265b404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
7  CoreFoundation                 0x18265ac2c __CFRunLoopDoSources0 + 276
8  CoreFoundation                 0x18265879c __CFRunLoopRun + 1204
9  CoreFoundation                 0x182578da8 CFRunLoopRunSpecific + 552
10 WebCore                        0x18a805dcc RunWebThread(void*) + 592
11 libsystem_pthread.dylib        0x1822d9220 _pthread_body + 272
12 libsystem_pthread.dylib        0x1822d9110 _pthread_body + 290
13 libsystem_pthread.dylib        0x1822d7b10 thread_start + 4

We see no path to our code and suspect something in the JavaScript runtime of the UIWebView triggering the bug but are out of idea atm.

msung
  • 3,562
  • 3
  • 19
  • 30
  • Over at apple forums (https://forums.developer.apple.com/thread/97676) there is an idea that it has to do with javascript and onpageunload or similar. Can you reproduce this locally? If you keep cutting out various parts of the webpage until the crashes stop hopefully you could find what specific javascript is causing the problem, and make a standalone test case which is what Apple will want to see for this, as this is a problem Apple needs to fix... I'd do this myself but I don't have a reproducible crash from html/javascript yet. – EGB Apr 06 '18 at 13:58

2 Answers2

0

I solved the problem by disabling the JIT in JavaScriptCore (WebKit).

I put this in my AppDelegate:

setenv("JSC_useJIT", "false", 0);

I hope this will help.

Kind regards, Josh.

0

We have mediated the issue by blocking a JavaScript file that was

  • embedded in an iFrame
  • had implemented a callback for onunload events
  • tried to do some request-y stuff.

We can also no longer reproduce this bug from iOS 11.4+ onwards.

msung
  • 3,562
  • 3
  • 19
  • 30