You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/04/06 21:10:00 UTC

[jira] [Commented] (CB-14020) cordova-plugin-geolocation crashes with "Collection was mutated while being enumerated"

    [ https://issues.apache.org/jira/browse/CB-14020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16429010#comment-16429010 ] 

ASF GitHub Bot commented on CB-14020:
-------------------------------------

elijahr opened a new pull request #104: CB-14020: (ios) Fix "Collection was mutated while being enumerated" crash
URL: https://github.com/apache/cordova-plugin-geolocation/pull/104
 
 
   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist
   is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   
   @seeday created pull request https://github.com/apache/cordova-plugin-geolocation/pull/91 but there was no issue created in the JIRA database and the commit message did not follow the correct format.  I have created the issue in JIRA and have added a merge commit reflecting the correct commit message format.
   
   https://issues.apache.org/jira/browse/CB-14020 
   
   
   ### Platforms affected
   iOS
   
   ### What does this PR do?
   Fix `Collection was mutated while being enumerated` crash
   
   ### What testing has been done on this change?
   I have manually tested these changes in my app and the plugin is working as expected, without issue.
   
   ### Checklist
   - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
   - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
   - ~Added automated test coverage as appropriate for this change.~ n/a - this is a race-condition and I don't believe it to be something that could be covered by automated tests
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> cordova-plugin-geolocation crashes with "Collection was mutated while being enumerated"
> ---------------------------------------------------------------------------------------
>
>                 Key: CB-14020
>                 URL: https://issues.apache.org/jira/browse/CB-14020
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-geolocation
>    Affects Versions: Master
>         Environment: iOS 11
> cordova-ios@4.3.1
> cordova-plugin-geolocation@2.4.2
> Although I am running an older version, this issue does not appear to be fixed in the latest plugin version as the relevant code has not been changed.
> The javascript in my app is making multiple calls to `navigator.geolocation.getCurrentPosition()` in rapid succession.
>            Reporter: Elijah R
>            Priority: Major
>              Labels: crash, easyfix, pull-request-available, race-condition
>         Attachments: crash-log.txt
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org