Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11897

cordova-plugin-wkwebview-engine crashes app on startup if Safari is set to "Automatically Show Web Inspector for JSContexts"

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      If in Safari the Simulator/iPhone is set to automatically show web inspector when the cordova-plugin-wkwebview-engine is in use the app will crash on startup.

      Versions:
      Safari: 10.0 (12602.1.50.0.10)
      OS X: 10.12 (16A323)
      Xcode: 8.0 (8A218a)
      Cordova: 6.3.1
      Cordova WebKit Engine: 1.1.0

      To repro:
      1. Create a new test app and add the cordova-plugin-wkwebview-engine plugin to it.
      2. Open the iOS project in Xcode.
      3. Run the Simulator.

      If it didn't crash:
      4. In Safari go to Develop->Simulator->Automatically Show Web Inspector for JSContexts and ensure it's checked.
      5. Restart the app in Xcode. It should crash.

      The output in Xcode will be something like:

      testApp(3824,0x1ae6eec40) malloc: *** error for object 0x1700a7e60: pointer being freed was not allocated

          • set a breakpoint in malloc_error_break to debug

      I spent most of the day trying to repro this consistently because I was seeing the crash on my iPhone but not in the Simulator. Once I realized it was this setting I'm able to reproduce it consistently on both.

      Also if you remove the CordovaWebViewEngine preference that is set to CDVWKWebViewEngine the app will not crash.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            shazron Shazron Abdullah
            bradr Brad Reynolds
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment