iOS Webview Crash


I have found a crash when presenting a modal view controller which contains a web view.
The crash happens when I dismiss the view controller.

It seems that the crash appears only when the modal view controller switches the orientation.
I’ve attached a simple test app and a crash log.

The crash is 100% reproducible on some devices (I’ve tried at least three).

  1. Start the application in portrait and then tap the screen
  2. Wait 6 seconds

Can you guys please take a look? (4.6 MB)


The crash is 100% reproducible on some devices (I’ve tried at least three)"

Do you remember what devices they were, and on what iOS version they had?


The devices are:
iPhone 6 Plus, firmware 9.3.1
iPhone 6, firmware 11.1.2
iPhone X, firmware 11.4

Here is more info on this:

  1. If I release the web view with 1 second before dismissing the view controller, it won’t crash.
    Probably the OS will invoke the garbage collector on the web view and release the WebThread before the dismiss. Unfortunately, I have no way to invoke the garbage collector earlier.

  2. The crash always happens on a lock made by WebThread.

My guess is that the WebThread is performing a lock on the UI thread and this causes conflicts with your engine.
Does the modal view controller interfere with your rendering engine, especially when it changes the orientation?

For instance, are you blocking the UI thread when the orientation changes?