Titanium JIRA Archive
Appcelerator Community (AC)

[AC-900] Application crashes on resume

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-04-23T04:40:15.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelscrash, ios, mobile, titanium
ReporterAnastasia KRYUKOVA
AssigneeRitu Agrawal
Created2014-04-15T08:27:20.000+0000
Updated2016-03-08T07:37:12.000+0000

Description

Hi Our crash reports tool logs frequently the application crashes when app is being resumed. You may see the details on the log below. The logs point to AppModule.m line 221, where inside the fireEvent method the mutable collection (array) is iterated. As far as we could not reproduce this bug we suppose there are more than one thread that access this method and try to modify and iterate over the same array simultaneously. According to this, one of the reasonable fix is to put the piece of code that treats array in a synchronized statement block by means of @synchronized(array). Do you find this fix appropriate? Or maybe you could suggest other solutions? LOGS: Fatal Exception: NSGenericException *** Collection <__NSArrayM: 0x15f74420> was mutated while being enumerated. AppModule.m line 221 -[AppModule fireEvent:] Thread : Fatal Exception: NSGenericException 0 CoreFoundation 0x2d857fd3 __exceptionPreprocess + 130 1 libobjc.A.dylib 0x38004ccf objc_exception_throw + 38 2 CoreFoundation 0x2d857ad1 -[NSException name] 3 Shopmium 0x001823b1 -[AppModule fireEvent:] (AppModule.m:221) 4 CoreFoundation 0x2d81a1f1 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12 5 CoreFoundation 0x2d78e57f _CFXNotificationPost + 1718 6 Foundation 0x2e178a3d -[NSNotificationCenter postNotificationName:object:userInfo:] + 76 7 Foundation 0x2e17d31b -[NSNotificationCenter postNotificationName:object:] + 30 8 Shopmium 0x001b25e9 -[TiApp applicationWillEnterForeground:] (TiApp.m:793) 9 UIKit 0x302d4c77 -[UIApplication _sendWillEnterForegroundCallbacks] + 94 10 UIKit 0x3027a1b5 -[UIApplication _handleApplicationResumeEvent:] + 1148 11 UIKit 0x30079085 -[UIApplication handleEvent:withNewEvent:] + 1872 12 UIKit 0x30078871 -[UIApplication sendEvent:] + 72 13 UIKit 0x300dccc9 _UIApplicationHandleEvent + 616 14 GraphicsServices 0x32691aed _PurpleEventCallback + 608 15 GraphicsServices 0x326916d7 PurpleEventCallback + 34 16 CoreFoundation 0x2d822ab7 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34 17 CoreFoundation 0x2d822a53 __CFRunLoopDoSource1 + 346 18 CoreFoundation 0x2d821227 __CFRunLoopRun + 1398 19 CoreFoundation 0x2d78bf4f CFRunLoopRunSpecific + 522 20 CoreFoundation 0x2d78bd33 CFRunLoopRunInMode + 106 21 GraphicsServices 0x32690663 GSEventRunModal + 138 22 UIKit 0x300d716d UIApplicationMain + 1136 23 Shopmium 0x000d73c3 main (main.m:36) 24 libdyld.dylib 0x38511ab7 start + 2

Comments

  1. Ritu Agrawal 2014-04-17

    We do not want to synchronize an array unless we really want to restrict access to it by a single thread. We would need a simple test case to reproduce this issue so that we can identify the root cause and come up with a proper solution.
  2. Ritu Agrawal 2014-04-23

    Resolving this issue as we cannot reproduce this issue and reporter has not provided a test case.

JSON Source