Menu

Crash on ZBarReaderView didTrackSymbols:.

2014-05-06
2024-07-19
  • Mariano Abdala

    Mariano Abdala - 2014-05-06

    Hi, I've been using the SDK (1.3.1) via CocoaPods in one of my projects.

    I've just had a user reporting this crash:
    ZBarReaderView.m line 585
    -[ZBarReaderView didTrackSymbols:]

    Apparently the reason is that the syms array was mutated while being enumerated:
    Fatal Exception: NSGenericException
    *** Collection <ZBarSymbolSet: 0x170422e00=""> was mutated while being enumerated.

    Full call stack:
    Thread : Fatal Exception: NSGenericException
    0 CoreFoundation 0x000000018da7ef50 exceptionPreprocess + 132
    1 libobjc.A.dylib 0x0000000199f881fc objc_exception_throw + 60
    2 CoreFoundation 0x000000018da7e984 -[NSException name]
    3 Trov 0x0000000100205530 -[ZBarReaderView didTrackSymbols:] (ZBarReaderView.m:585)
    4 Foundation 0x000000018e6005cc
    NSThreadPerformPerform + 328
    5 CoreFoundation 0x000000018da3f644 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
    6 CoreFoundation 0x000000018da3e9a0 CFRunLoopDoSources0 + 256
    7 CoreFoundation 0x000000018da3cc38
    CFRunLoopRun + 632
    8 CoreFoundation 0x000000018d97dc20 CFRunLoopRunSpecific + 452
    9 GraphicsServices 0x0000000193665c0c GSEventRunModal + 168
    10 UIKit 0x0000000190aaefdc UIApplicationMain + 1156
    11 [MyApp] 0x000000010004f490 main (main.m:16)
    12 libdyld.dylib 0x000000019a57baa0 start + 4

    I was wondering if you've seen this before or if you know of a way to fix this.

    Thanks,
    Marino.

     
    • Manikandan

      Manikandan - 2015-12-04

      Hi, we are also facing the same issue. I tried resolving the issue by intretraing the mutable copy of the ZBarSymbolSet by regular for loop and still its crashing. Did you find other way to fix the issue ?
      Thanks in advance.

       
  • PabloCarrillo

    PabloCarrillo - 2014-06-02

    Hi,
    I am seeing the same thing from the same version,
    Seems like the enumeration that happens inside is not always secure to do.
    I think the easiest fix is simply change the fast enumeration for a simple for loop.

    I would send a pull request but I don't get the Mercurial thing, sorry.

    Thanks,
    Pablo

     
    • Manikandan

      Manikandan - 2015-12-04

      Hi Pablo, thanks for the suggestion. I tried "for" loop solution on mutable copy of the original ZBarSymbolSet. Still its crashing. Can you please share your thoughts ?
      Thanks,
      Mani

       
  • panda89

    panda89 - 2023-10-17

    There are numerous well-known video games today, but you might not be familiar with this one. Spend some time playing it to see how fantastic it is! run 3

     
  • akinson 12

    akinson 12 - 2024-07-19

    Certainly! You can make a copy of the syms array and iterate over the copy to avoid mutation during enumeration in three lines dgme

     

Log in to post a comment.