{ "id": "117122", "key": "TIMOB-14572", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2014-08-08T05:54:24.000+0000", "created": "2013-07-12T08:00:17.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "i0S", "listview" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T22:07:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h6.Problem\r\nI found ListViews to be very fragile, and crashing the app frequently. Here is an example: In Kitchen sink replace \"list_performance_remote_images.js\" with the code below. \r\n\r\nBase UI --> Views --> ListView --> Remote Images In List View\r\n\r\nh6.Steps to reproduce\r\n(1) After clicking \"Show Me\" click the back button in the iOS simulator.\r\n(2) I put a 2 second delay between the button click and the start of appending items to the ListView.\r\n(3) Try to click the back button at the instant *BEFORE* you actually see items appearing - i.e. as the CPU is processing the items.\r\n(4) In about 1 in 3 cases the app will crash. \r\n\r\nWhile this test may appear contrived, in real apps it happens frequently that users switch views while rendering is occurring. I am emphasizing that I have never seen such issues with ScrollViews. The ListViews need to be much more robust.\r\n\r\nh6.Snippet code\r\n{code}\r\nvar listView;\r\n\r\nfunction genData (){\r\n\tvar baseUrl = 'http://placehold.it/';\r\n\tvar imageUrl;\r\n\tfor (i=30;i<=60;i++){\r\n\t\tfor (j=30;j<=60;j++){\r\n\t\t\timageUrl = baseUrl+i+'x'+j;\r\n\t\t\tlistView.sections[0].appendItems([{avatar:{image:imageUrl},info:{text:'Loading Url\\n'+imageUrl}}]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction setupTest(win){\r\n\tvar myTemplate = {\r\n\t\tproperties: {height:60},\r\n\t\tchildTemplates: [\r\n\t\t{\r\n\t\t\ttype: 'Ti.UI.ImageView',\r\n\t\t\tbindId: 'avatar',\r\n\t\t\tproperties: {\r\n\t\t\t\tleft: 10,\r\n\t\t\t\twidth: 50, height: 50\r\n\t\t\t},\r\n\t\t},\r\n\t\t{\r\n\t\t\ttype: 'Ti.UI.Label',\r\n\t\t\tbindId: 'info',\r\n\t\t\tproperties: {\r\n\t\t\t\tcolor: 'white',\r\n\t\t\t\tfont: { fontFamily:'Arial', fontSize: 13, fontWeight:'bold' },\r\n\t\t\t\tleft: 70, top: 5, bottom:5, wordWrap:true, ellipsize:true,\r\n\t\t\t\twidth: Ti.UI.FILL, height: 50\r\n\t\t\t},\r\n\t\t}\r\n\t\t]\r\n\t};\t\r\n\t\r\n\tvar section = Ti.UI.createListSection({headerTitle:'A bunch of remote images'});\r\n\tlistView = Ti.UI.createListView({\r\n\t\tsections: [section],\r\n\t\ttemplates: { 'template': myTemplate },\r\n\t\tdefaultItemTemplate: 'template',\r\n\t\tbackgroundColor: 'black',\r\n\t});\r\n\t\r\n\twin.add(listView);\t\r\n\tfunction populateListView(){\r\n\t\tTi.API.info('start');\r\n\t\tgenData();\r\n\t}\r\n\tsetTimeout(populateListView, 2000);\r\n\t\r\n}\r\n\r\nfunction list_performance_remote(_args) {\r\n\tvar win = Ti.UI.createWindow({\r\n\t\ttitle:'Remote Image Test',\r\n\t\torientationModes:[Ti.UI.PORTRAIT],\r\n\t\tlayout:'vertical'\r\n\t});\r\n\r\n\tvar desc = Ti.UI.createLabel({\r\n\t\ttext:'This is a list View that uses a custom template that holds an imageView and a label.\\n'+\r\n\t\t'The imageView loads remote images. Thank you placehold.it\\n'+\r\n\t\t'Expected performance is a smooth scroll experience.\\n'+\r\n\t\t'On scrolling back and forth in the list view, the right image must be loaded.(since we are reusing views)\\n\\n'\r\n\t})\r\n\t\r\n\tvar button = Ti.UI.createButton({title:'Show Me',top:10});\r\n\t\r\n\twin.add(desc);\r\n\twin.add(button);\r\n\t\r\n\tbutton.addEventListener('click',function(){\r\n\t\twin.remove(desc);\r\n\t\twin.remove(button);\r\n\t\tsetupTest(win);\r\n\t})\r\n\t\r\n\treturn win;\r\n}\r\n\r\nmodule.exports = list_performance_remote;\r\n{code}\r\n\r\nh6.Console output\r\nUsually in the console I see just:\r\n- [ERROR] : An error occurred running the iOS Simulator\r\n\r\nOn occasion I also see this while running this experiment:\r\n{code}\r\n[ERROR] : The application has crashed with an uncaught exception 'NSInvalidArgumentException'.\r\n[ERROR] : Reason:\r\n[ERROR] : -[__NSDictionaryM bounds]: unrecognized selector sent to instance 0xb5e5eb0\r\n[ERROR] : Stack trace:\r\n[ERROR] : 0 CoreFoundation 0x038fe012 __exceptionPreprocess + 178\r\n[ERROR] : 1 libobjc.A.dylib 0x03593e7e objc_exception_throw + 44\r\n[ERROR] : 2 CoreFoundation 0x039894bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 253\r\n[ERROR] : 3 CoreFoundation 0x038edbbc ___forwarding___ + 588\r\n[ERROR] : 4 CoreFoundation 0x0392a77e __forwarding_prep_1___ + 14\r\n[ERROR] : 5 KitchenSink 0x0007d54e -[TiViewProxy relayout] + 334\r\n[ERROR] : 6 KitchenSink 0x0007c6c3 -[TiViewProxy refreshView:] + 675\r\n[ERROR] : 7 KitchenSink 0x0007df33 -[TiViewProxy layoutChildrenIfNeeded] + 259\r\n[ERROR] : 8 KitchenSink 0x001fb5a7 +[TiLayoutQueue layoutProxy:] + 87\r\n[ERROR] : 9 KitchenSink 0x001fb372 performLayoutRefresh + 530\r\n[ERROR] : 10 CoreFoundation 0x038bd376 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22\r\n[ERROR] : 11 CoreFoundation 0x038bce06 __CFRunLoopDoTimer + 534\r\n[ERROR] : 12 CoreFoundation 0x038a4a82 __CFRunLoopRun + 1810\r\n[ERROR] : 13 CoreFoundation 0x038a3f44 CFRunLoopRunSpecific + 276\r\n[ERROR] : 14 CoreFoundation 0x038a3e1b CFRunLoopRunInMode + 123\r\n[ERROR] : 15 GraphicsServices 0x0382d7e3 GSEventRunModal + 88\r\n[ERROR] : 16 GraphicsServices 0x0382d668 GSEventRun + 104\r\n[ERROR] : 17 UIKit 0x0138fffc UIApplicationMain + 1211\r\n[ERROR] : 18 KitchenSink 0x00004ad8 main + 456\r\n[ERROR] : 19 KitchenSink 0x000033e5 start + 53\r\n[ERROR] : 20 ??? 0x00000001 0x0 + 1\r\n[ERROR] : 2013-07-12 10:58:13.643 KitchenSink[38581:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM bounds]: unrecognized selector sent to instance 0xb5e5eb0'\r\n[ERROR] : *** First throw call stack:\r\n[ERROR] : (0x38fe012 0x3593e7e 0x39894bd 0x38edbbc 0x392a77e 0x7d54e 0x7c6c3 0x7df33 0x1fb5a7 0x1fb372 0x38bd376 0x38bce06 0x38a4a82 0x38a3f44 0x38a3e1b 0x382d7e3 0x382d668 0x138fffc 0x4ad8 0x33e5 0x1)\r\n-- End simulator log ---------------------------------------------------------\r\n[ERROR] : An error occurred running the iOS Simulator\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Closing window while rendering ListView crashes app", "creator": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "subtasks": [], "reporter": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "environment": "SDK 3.1.1.GA, iOS 6.1 simulator", "comment": { "comments": [ { "id": "261606", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2013-07-12T08:05:20.000+0000", "updated": "2013-07-12T08:05:20.000+0000" }, { "id": "317647", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Titanium Command-Line Interface, CLI version 3.3.0, \r\nTitanium SDK version 3.3.0.GA\r\niOS 7 ", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-08T05:54:24.000+0000", "updated": "2014-08-08T05:54:24.000+0000" }, { "id": "414537", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced and due to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T22:07:35.000+0000", "updated": "2017-03-21T22:07:35.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }