[
https://issues.apache.org/jira/browse/CB-14020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16538407#comment-16538407
]
ASF GitHub Bot commented on CB-14020:
-------------------------------------
Unibozu commented on issue #104: CB-14020: (ios) Fix "Collection was mutated
while being enumerated" crash
URL:
https://github.com/apache/cordova-plugin-geolocation/pull/104#issuecomment-403786092
Some visibility regarding this issue would be appreciated.
About 5% of our users (more than 2,000 over the last 3 months) are affected
by this issue. Since the exception is not caught, it crashes the app as soon as
`addWatch` is called under specific circumstances (which we haven't been able
to reproduce). We call `addWatch` very early when our application starts, and
some users have reported that trying to start the app again multiple times in a
row seems to be a temporary solution.
It's irrelevant of the iOS version or iphone model.
Almost all of these crashes are due to CDVLocation

----------------------------------------------------------------
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:
[email protected]
> 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
> [email protected]
> [email protected]
> 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: [email protected]
For additional commands, e-mail: [email protected]