QRCodeReader.swift icon indicating copy to clipboard operation
QRCodeReader.swift copied to clipboard

Exception: Array mutated while being enumerated

Open guthriec opened this issue 5 years ago • 3 comments

An issue came up in our app's Crashlytics that unfortunately I haven't been able to reproduce. No info on context, other than it's on an iPhone X running iOS 12.4.1.

Screen Shot 2020-01-20 at 9 08 54 AM

Any thoughts would be great.

guthriec avatar Jan 20 '20 16:01 guthriec

Very interesting.

The only place where the metadataObjectTypes are mutating is during the initialisation. Maybe a race condition during the init workflow?

Needs more investigation.

yannickl avatar Jan 20 '20 19:01 yannickl

I also got this crash reported today (see attachment). I've been trying to reproduce it with no luck.

One thing I noticed on the QRCodeReader init (and raised some suspicion regarding the race condition that you mentioned) is the use of a queue to perform the session configuration asynchronously. Is there a particular reason for dispatching in a queue instead of doing "directly"?

sessionQueue.async {
    self.configureDefaultComponents(withCaptureDevicePosition: captureDevicePosition)
}
Screen Shot 2020-01-23 at 13 57 01

lm2s avatar Jan 23 '20 14:01 lm2s

Getting the same crash on crashlytics in QRCodeReader.init

sessionQueue.async {
    self.configureDefaultComponents(withCaptureDevicePosition: captureDevicePosition)
}

Im unable to reproduce it @lm2s @yannickl Any news regarding that one ?

dvertovsek avatar Apr 22 '20 21:04 dvertovsek