Search code examples
uiwebviewcrashwebkitios11wkwebview

UIWebView/WKWebView crash on iOS11 (ran out of executable memory)


Loading some web pages using UIWebView or WKWebView on iOS 11 causing crash with reason "Ran out of executable memory while allocating 128 bytes". The attached screenshot shows the full stack trace. It seems to be a problem with Webkit's Javascript engine. There was no such a problem on iOS 10 and earlier. So it's new on iOS 11. No problem on Simulator. Only on real device.

Here is an example URL which causes a crash: https://wstream.video/mobi/iu94ezdbr6h4

Here is a screenshot


Solution

  • The crypto mining script in your provided site causes this crash :(

    If you truly want to mine a bitcoin in your webview, you can set the following environment variable to disable the buggy JIT in iOS 11:

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