{ "id": "142142", "key": "AC-1549", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "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": "2015-06-29T16:45:52.000+0000", "created": "2014-12-30T05:51:49.000+0000", "labels": [ "3.3.0", "3.4.1", "TCSupportTriage", "cache", "crash", "imageview", "ios", "iphone", "listview" ], "versions": [], "issuelinks": [], "assignee": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "updated": "2016-03-08T07:38:00.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I've never seen this crash myself, but we get ~130-140 crashes a day reported in Crashlytics on this line (ImageLoader.m:294).\r\n\r\nIn the code, I have a ListView with one ListSection, and use the following code to append ListViewItems 10 at a time, as the user scrolls (using a marker). Scrolling is allowed indefinitely. I'm guessing this crash is happening for users who view hundreds or thousands of ListViewItems, because I've never seen it happen in my normal usage of maybe a hundred ListViewItems in a ListView:\r\n\r\nThe ListView template is very basic (image property is set by appendItems):\r\n{code}\r\nvar SCREEN_WIDTH = Ti.Platform.displayCaps.platformWidth;\r\n\r\nvar template = {\r\n\tproperties : {\r\n\t\tbackgroundColor : \"#fff\",\r\n\t\theight : Ti.UI.SIZE\r\n\t},\r\n\tchildTemplates : [{\r\n\t\ttype : \"Ti.UI.View\",\r\n\t\tproperties : {\r\n\t\t\tlayout : \"vertical\",\r\n\t\t\twidth : Ti.UI.FILL,\r\n\t\t\theight : Ti.UI.SIZE,\r\n\t\t\tbackgroundColor : \"#fff\"\r\n\t\t},\r\n\t\tchildTemplates : [{\r\n\t\t\ttype : \"Ti.UI.ImageView\",\r\n\t\t\tbindId : \"photo\",\r\n\t\t\tproperties : {\r\n\t\t\t\tbackgroundColor : \"#fff\",\r\n\t\t\t\theight : SCREEN_WIDTH,\r\n\t\t\t\twidth : SCREEN_WIDTH,\r\n\t\t\t\tpreventDefaultImage : true\r\n\t\t\t}\r\n\t\t}]\r\n\t}]\r\n};\r\n{code}\r\n\r\nUsing simple appendItems to add 10 items at a time:\r\n\r\n{code}\r\n//'section' is a reference to the singleListViewSection. 'data' is the image property on the 'photo' bindId above and text for a Label in the template\r\n\r\nsection.appendItems([data], {\r\n\t\tanimated : false,\r\n\t\tanimationStyle : Ti.UI.iPhone.RowAnimationStyle.NONE\r\n});\r\n{code}\r\n\r\nAnd here's the crash thread dump:\r\n{code}\r\nThread : Crashed: NSOperationQueue 0x158415d0 :: NSOperation 0x14541400\r\n0 libsystem_c.dylib 0x2f9577d4 strlen + 28\r\n1 APPNAME 0x000edfd9 +[ImageCacheEntry cachePathForURL:] (ImageLoader.m:294)\r\n2 APPNAME 0x000edfd9 +[ImageCacheEntry cachePathForURL:] (ImageLoader.m:294)\r\n3 APPNAME 0x000edbb9 -[ImageCacheEntry initWithURL:] (ImageLoader.m:229)\r\n4 APPNAME 0x000ee6f9 -[ImageLoader setImage:forKey:hires:] (ImageLoader.m:432)\r\n5 APPNAME 0x000eebe3 -[ImageLoader cache:forURL:size:hires:] (ImageLoader.m:540)\r\n6 APPNAME 0x000ef8c1 -[ImageLoader request:onLoad:] (ImageLoader.m:789)\r\n7 APPNAME 0x002e1a79 -[APSHTTPRequest invokeCallbackWithState:] (APSHTTPRequest.m:343)\r\n8 CFNetwork 0x218015a1 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 56\r\n9 Foundation 0x2299dae1 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 8\r\n10 Foundation 0x22908b7d -[NSBlockOperation main] + 148\r\n11 Foundation 0x228fb337 -[__NSOperationInternal _start:] + 774\r\n12 Foundation 0x229a044b __NSOQSchedule_f + 186\r\n13 libdispatch.dylib 0x2f922651 _dispatch_queue_drain + 952\r\n14 libdispatch.dylib 0x2f91d09d _dispatch_queue_invoke + 84\r\n15 libdispatch.dylib 0x2f923ba1 _dispatch_root_queue_drain + 320\r\n16 libdispatch.dylib 0x2f924cd7 _dispatch_worker_thread3 + 94\r\n17 libsystem_pthread.dylib 0x2fa7be31 _pthread_wqthread + 668\r\n{code}\r\n\r\nI'm happy to provide any information I can, or even use a modified SDK and report back results or add more logging. Let me know what I can do.", "attachment": [ { "id": "53374", "filename": "crashlytics-device-info.png", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-30T05:51:49.000+0000", "size": 82370, "mimeType": "image/png" } ], "flagged": false, "summary": "ImageView with remote image in ListView crash: cachePathForURL EXC_BAD_ACCESS KERN_INVALID_ADDRESS", "creator": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK: 3.4.1.GA (I've also seen the crash on 3.3.0.GA)\r\nDevices: Happening on all devices (iPhone, iPad, iPod) on all recent iOS versions (6, 7, and 8)", "comment": { "comments": [ { "id": "353654", "author": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "body": "SDK 3.5.1.GA. See the same EXC_BAD_ACCESS when app trying to load non-existing remote image. Happens randomly. Not tried in 4.0.0 yet.\r\n\r\nBacktrace from Xcode:\r\n#0 0x000000019477bbdc in objc_msgSend ()\r\n#1 0x000000010017e12c in -[ImageLoaderRequest cancel] at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/ImageLoader.m:334\r\n#2 0x00000001001084a8 in -[TiUIImageViewProxy cancelPendingImageLoads] at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiUIImageViewProxy.m:203\r\n#3 0x000000010010bf4c in -[TiUIImageView cancelPendingImageLoads] at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiUIImageView.m:445\r\n#4 0x000000010010d648 in -[TiUIImageView setImage_:] at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiUIImageView.m:667\r\n#5 0x000000010011aa90 in __DoProxyDelegateChangedValuesWithProxy_block_invoke54 at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiProxy.m:92\r\n#6 0x00000001001513cc in __TiThreadPerformOnMainThread_block_invoke at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiBase.m:270\r\n#7 0x0000000100151810 in TiThreadProcessPendingMainThreadBlocks at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiBase.m:367\r\n#8 0x00000001001515e0 in __TiThreadPerformOnMainThread_block_invoke208 at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiBase.m:308\r\n#9 0x00000001011e4e30 in _dispatch_call_block_and_release ()\r\n#10 0x00000001011e4df0 in _dispatch_client_callout ()\r\n#11 0x00000001011e975c in _dispatch_main_queue_callback_4CF ()\r\n#12 0x0000000184021fa4 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()\r\n#13 0x000000018402004c in __CFRunLoopRun ()\r\n#14 0x0000000183f4d0a4 in CFRunLoopRunSpecific ()\r\n#15 0x000000018d0ef5a4 in GSEventRunModal ()\r\n#16 0x000000018887eaa4 in UIApplicationMain ()\r\n#17 0x0000000100069b48 in main at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/main.m:37\r\n#18 0x0000000194dd6a08 in start ()\r\nEnqueued from com.apple.root.default-qos.overcommit (Thread 8)Queue : com.apple.root.default-qos.overcommit (serial)\r\n#0 0x00000001011f2dac in _dispatch_barrier_async_f_slow ()\r\n#1 0x0000000100150f14 in TiThreadPerformOnMainThread at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiBase.m:311\r\n#2 0x000000010011a958 in DoProxyDelegateChangedValuesWithProxy at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiProxy.m:92\r\n#3 0x00000001000cc30c in -[TiUIView propertyChanged:oldValue:newValue:proxy:] at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiUIView.m:887\r\n#4 0x0000000100120a00 in -[TiProxy replaceValue:forKey:notification:] at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiProxy.m:1154\r\n#5 0x00000001001082f8 in -[TiUIImageViewProxy setImage:] at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/TiUIImageViewProxy.m:184\r\n#6 0x0000000100091f58 in -[KrollObject setValue:forKey:] at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/KrollObject.m:937\r\n#7 0x000000010008e7c0 in KrollSetProperty at /Users/bobr/Documents/My/Work/cleverbug/repos/app/build/iphone/Classes/KrollObject.m:292\r\n\r\n\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.10\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 0.12.0\r\n npm Version = 2.5.1\r\nTitanium CLI\r\n CLI Version = 4.0.0\r\nTitanium SDK\r\n SDK Version = 3.5.1.GA\r\n SDK Path = /Users/bobr/Library/Application Support/Titanium/mobilesdk/osx/3.5.1.GA\r\n Target Platform = iphone", "updateAuthor": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2015-05-27T15:03:07.000+0000", "updated": "2015-05-27T15:03:07.000+0000" }, { "id": "356148", "author": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "body": "[~athorne], [~bobrosoft] can you please attach a test case and steps to reproduce? we can not replicate this issue", "updateAuthor": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "created": "2015-06-26T23:58:07.000+0000", "updated": "2015-06-26T23:58:07.000+0000" }, { "id": "356182", "author": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "body": "Hi there. Sorry, my case happened because I tried to fallback to another image on \"error\" event (i.e. when remote image not found) and that fallback image not exists too (I not noticed that straight away), so that created infinite loop of \"error\" event triggering which I think lead to some *race condition* in ImageLoader and to that crash. That's a *minor* issue, happened because of my erroneous implementation of fallback images layout, but if you want to repeat, you need something as\r\n{code}\r\nimage.addEventListener('error', function(){\r\n image.image = 'unexisting_fallback_image.jpg';\r\n});\r\n\r\nimage.image = 'unexisting_image.jpg';\r\n{code}", "updateAuthor": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2015-06-27T20:35:29.000+0000", "updated": "2015-06-27T20:35:29.000+0000" }, { "id": "356183", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We can't reproduce it. What I can say is we don't use a fallback image, however it's possible for our initial image to 404. If I'm able to reproduce it I'll add a test case.", "updateAuthor": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-27T22:05:55.000+0000", "updated": "2015-06-27T22:05:55.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }