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

cordova-plugin-geolocation crashes with "Collection was mutated while being enumerated"

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Master
    • None

    Description

      There is a race condition in CDVLocation.m. The self.locationData.locationCallbacks array can be mutated in one thread and enumerated concurrently in another thread, which causes the app to crash with the following exception:

      Fatal Exception: NSGenericException
      Collection <__NSArrayM: 0x1d444d020> was mutated while being enumerated.

      The exception is raised at [CDVLocation returnLocationError:withMessage:] (CDVLocation.m:312)

      I am unable to reproduce the issue, however it is a common crash for users of my app. A user named seeday on github has opened a pull request to address this issue: https://github.com/apache/cordova-plugin-geolocation/pull/91

      I'm filing this bug to help get that work merged.

      I've attached an abridged crash log with the relevant stack trace.

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            elijahr Elijah R
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment