iOS Uiwebview Crash in "Webthread"

Crash in UIWebView in iOS 11.3 (and 11.4)

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.

iOS UIWebView crash in WebThread

I see that you have iOs 5.0.
Are the files that you're loading Office documents (docx, xls)?

If so, then your case is the same as mine. This problem reproduces only on systems with 5.0 (iPad and iPad 2 here), and happens when you try to stop UIWebView object before it finishes loading the file. Whether it's by calling stopLoading or loadRequest

This doesn't happen with txt files.

And if it does, it originates in WebThread starting from line:

#1  0x34912158 in -[QuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:] ()

and jumping to some random pointers like:

#0  0x00000010 in 0x00000010 ()

iOS WebView WTF crash

Finally, I find that this crash is related to localstorage thread. When we call window.localStorage in JavaScript, it triggers webkit to create a localstorage thread and the thread will be destoryed when all the UIWebView instances dealloc. In fact, the localstorage thread will be destoryed later than the UIWebView instance which causes wild pointer crash. So, you can create a UIWebView instance which execute "window.localstorage.setItem(x,x)" and never destory it or you can use WKWebView.

How to fix 'iOS crash Crashed: WebThread EXC_BREAKPOINT 0x00000001efac65c0'

I think this crash is caused by UIWebview's bad memery management. After I replace UIWebview by WKWebview. The crash never happened again.



Related Topics



Leave a reply



Submit