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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Master
    • Fix Version/s: None
    • Environment:

      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

        1. crash-log.txt
          3 kB
          Elijah R

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: