Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19214] iOS: Regression: TiUIImageView.images property crashes app in 4.1.0.GA

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-07-25T00:06:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.1, Release 5.0.0
ComponentsiOS
Labelsimageview, regression
ReporterEduardo Gomez
AssigneePedro Enrique
Created2015-07-14T03:11:50.000+0000
Updated2015-08-04T18:48:33.000+0000

Description

Issue Description

Crash when using animated ImageView with Titanium Mobile SDK 4.1.0.GA. When setting an array of image paths in the TiImageView.images property, the app gets no crash in 4.0.0.GA (iOS simulator/device).

Steps to Reproduce

1. Install attached sample (includes the images) 2. Launch it - the app should crash since 4.1.0.GA and above exhibiting the following outcomes: iOS 8.4 (iPhone 4s simulator) Crash iOS 8.2 (iPad) No crash iOS 7.1 (iPhone) Crash

Stack Trace

Jul 13 18:36:36 lAlO PriebeSandbox[224] <Warning>: [INFO] PriebeSandbox/1.0 (4.1.0.d57aa7d)
Jul 13 18:36:36 lAlO PriebeSandbox[224] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8695F53F-75E4-4328-8C30-C2AC3BD7CE19/PriebeSandbox.app/app.js, Resource: app_js
Jul 13 18:36:36 lAlO PriebeSandbox[224] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8695F53F-75E4-4328-8C30-C2AC3BD7CE19/PriebeSandbox.app/_app_props_.json, Resource: _app_props__json
Jul 13 18:36:37 lAlO PriebeSandbox[224] <Warning>: [ERROR] Script Error {
        column = 478;
        line = 1;
        message = "*** Collection <__NSArrayM: 0x145c0ed0> was mutated while being enumerated.";
        sourceURL = "file:///var/mobile/Applications/8695F53F-75E4-4328-8C30-C2AC3BD7CE19/PriebeSandbox.app/app.js";
        stack = "[native code]\nglobal code@file:///var/mobile/Applications/8695F53F-75E4-4328-8C30-C2AC3BD7CE19/PriebeSandbox.app/app.js:1:478";
    }
Jul 13 18:36:37 lAlO PriebeSandbox[224] <Warning>: [DEBUG] Application booted in 738.143027 ms

Attachments

FileDateSize
4.0.0.GA_Screen Shot.png2015-07-14T02:46:21.000+000026177
4.1.0.GA_Screen Shot.png2015-07-14T02:46:28.000+000095299
PriebeSandbox.zip2015-07-14T03:11:01.000+000010406811

Comments

  1. Matthias Benkort 2015-07-20

    Hi, I am having a similar issue. Until now, I still haven't located precisely which piece of code is responsible for the whole crash of the app... The only thing that I am doing is to instantiate a ListView with static content. And I get - sometimes - this error. I am using Ti 4.1.0.GA on iOS 8.3 on the iPad 2 Simulator. [ERROR] The application has crashed with an uncaught exception 'NSGenericException'. [ERROR] Reason: [ERROR] *** Collection <__NSArrayM: 0x7c14a990> was mutated while being enumerated. [ERROR] Stack trace: [ERROR] [ERROR] 0 CoreFoundation 0x052b972a __exceptionPreprocess + 154 [ERROR] 1 libobjc.A.dylib 0x04e8ca97 objc_exception_throw + 44 [ERROR] 2 CoreFoundation 0x052b8fe6 __NSFastEnumerationMutationHandler + 166 [ERROR] 3 Aviation Week Refactor 0x001a8696 DoProxyDelegateReadValuesWithKeysFromProxy + 1110 [ERROR] 4 Aviation Week Refactor 0x001436a1 -[TiUIView readProxyValuesWithKeys:] + 65 [ERROR] 5 Aviation Week Refactor 0x00119f57 -[TiViewProxy firePropertyChanges] + 167 [ERROR] 6 Aviation Week Refactor 0x00117ae2 -[TiViewProxy view] + 706 [ERROR] 7 Aviation Week Refactor 0x0036008d -[TiUIListViewProxy listView] + 45 [ERROR] 8 Aviation Week Refactor 0x00361464 __34-[TiUIListViewProxy setTemplates:]_block_invoke139 + 52
  2. David He 2015-07-21

    @Matthias Benkort I have exactly the same problem! What I found is that the crash seems to do with *ListView templates*. See my test result matrix below. ||iOS 8.2 simulator||iOS 8.3 simulator|| |ListView not display|Crash| It is happening so randomly - I will open another JIRA with ListView scenario tonight
  3. David He 2015-07-21

    It needs to be treated urgently! Now I have more places crashing my app due to this unclear problem. *Collection <__NSArrayM: 0x7c14a990> was mutated while being enumerated.*
  4. Matthias Benkort 2015-07-21

    For the moment, downgrading to 4.0.0.GA solved the issue on my side. So, it's likely to be a regression introduced with 4.1.0.GA. Also, I'm not that sure about the templates. I've tried to put only an empty ListView in an xml view file (I am using Alloy 1.6.2), without any template and It crashed in the exact same way (Maybe because of a default template or something related?) Hope those information will help.
  5. David He 2015-07-21

    We need this fixed ASAP.
  6. Eduardo Gomez 2015-07-21

    [~KtorZ] [~jialhe85@gmail.com] can someone raise a Jira ticket? It will be difficult to identify the crash scenario you talk about without reproducing the actual error. To be clear, those suffering the ImageView.images crash could use as _Work Around_ setting images array after ImageView creation and remove it from createImageView() instance for now, i.e.
       var theImageView = Ti.UI.createImageView ({
           top: 100,
           height: 40,
           width: 40,
           //images: images,
       });
       //
       theImageView.images = images;
       
  7. David He 2015-07-21

  8. Pedro Enrique 2015-07-24

    PR: https://github.com/appcelerator/titanium_mobile/pull/6983
  9. Pedro Enrique 2015-07-24

    PR for 4.1.X https://github.com/appcelerator/titanium_mobile/pull/6984
  10. Chee Kiat Ng 2015-07-25

    CR and FT Passed. PRs merged!
  11. Eric Wieber 2015-08-04

    Verified fixed, using: MacOS 10.11 Studio 4.2.0.201507201802 Ti SDK 4.1.1.v20150802200935 Appc NPM 4.2.0-1 Appc CLI 4.2.0-1 Ti CLI 4.1.2 Alloy 1.6.2 Node v0.10.37 Java 1.7.0_45 preproduction No crash is witnessed on the sims indicated in the ticket. Images display correctly.

JSON Source