{ "id": "169970", "key": "TIMOB-25506", "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": "20060", "description": "", "name": "Release 7.0.2", "archived": false, "released": true, "releaseDate": "2018-02-09" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-01-24T21:20:35.000+0000", "created": "2017-10-07T06:32:24.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Javascript", "android", "imageview", "listview" ], "versions": [], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-01-25T00:07:09.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "This bug is so difficult to reproduce.\r\nHowever, if your app loads a lot of images and consumes memory which will subsequently trigger GC constantly, then you will often see this bug very often. It appears to me that after some heavy GC is carried out by the system, listview will crashes either silently or with some errors.\r\n\r\nThe bugs appear to me like after the systems is GCed, the native system tried to access some invalid arraylist which is probably our list items but has been cleaned up during the GC. The full error logs is listed below -\r\n\r\n\r\n \r\n{color:green}[INFO] : art: Background partial concurrent mark sweep GC freed 39840(2MB) AllocSpace objects, 562(22MB) LOS objects, 24% free, 49MB/65MB, paused 1.766ms total 205.007ms\r\n[INFO] : art: Background sticky concurrent mark sweep GC freed 178393(7MB) AllocSpace objects, 75(1200KB) LOS objects, 11% free, 57MB/65MB, paused 2.294ms total 100.092ms\r\n[INFO] : I/Adreno-EGL: : EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.016_msm8226_LA.BF.1.1.1_RB1__release_AU ()\r\n[INFO] : I/Adreno-EGL: OpenGL ES Shader Compiler Version: E031.25.03.00\r\n[INFO] : I/Adreno-EGL: Build Date: 02/11/15 Wed\r\n[INFO] : I/Adreno-EGL: Local Branch:\r\n[INFO] : I/Adreno-EGL: Remote Branch: quic/LA.BF.1.1.1_rb1.10\r\n[INFO] : I/Adreno-EGL: Local Patches: NONE\r\n[INFO] : I/Adreno-EGL: Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.016 + 62ca4eb + acd831d + 9f8b442 + e027a02 + cba30ba + 53c303a + a649d79 + 23e16f8 + 5e97da7 + cbd2a44 + 33d072a + 7aacf06 + 72b33e7 + 28f6f60 + b4c13d8 + NOTHING\r\n[INFO] : OpenGLRenderer: Initialized EGL, version 1.4\r\n{color}\r\n{color:red}\r\n[ERROR] : TiApplication: (main) [51471,51471] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Iterator java.util.ArrayList.iterator()' on a null object reference; Titanium 6.2.2,2017/09/19 16:01,undefined\r\n[ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Iterator java.util.ArrayList.iterator()' on a null object reference\r\n[ERROR] : TiApplication: \tat org.appcelerator.titanium.util.TiDownloadManager.handleFireDownloadMessage(TiDownloadManager.java:104)\r\n[ERROR] : TiApplication: \tat org.appcelerator.titanium.util.TiDownloadManager.handleMessage(TiDownloadManager.java:174)\r\n[ERROR] : TiApplication: \tat android.os.Handler.dispatchMessage(Handler.java:98)\r\n[ERROR] : TiApplication: \tat android.os.Looper.loop(Looper.java:135)\r\n[ERROR] : TiApplication: \tat android.app.ActivityThread.main(ActivityThread.java:5343)\r\n[ERROR] : TiApplication: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[ERROR] : TiApplication: \tat java.lang.reflect.Method.invoke(Method.java:372)\r\n[ERROR] : TiApplication: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)\r\n[ERROR] : TiApplication: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)\r\n[INFO] : Process: Sending signal. PID: 15484 SIG: 9{color}\r\n\r\nSteps to reproduce [tested on moto G 1st gen phone with 1GB RAM]-\r\n1. Import the attached zip file to your titanium studio and run it in a system with limited memory.\r\n2. Try to scroll down quickly the listview as fast as possible. Click the LV BUTTON to change the contents of the listview (SO as to trigger GC).\r\n3. Still you see no crashes occurring? Cool, background the app for sometimes, open a a memory extensive app like a browser, load some heavy images, and before the system could terminate our backgrounded app, quickly bring up the app to foreground and do a rapid scroll.\r\n4. This time the app hangs up and crashes after a few rounds of GC.\r\n", "attachment": [ { "id": "63395", "filename": "gc_test.zip", "author": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-07T06:16:48.000+0000", "size": 749245, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: ImageView sometimes crashes when loading via URL", "creator": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.11.6\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 4.6.2\r\n npm Version = 2.15.11\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 6.2.2.GA\r\n SDK Path = /Users/libawo/Library/Application Support/Titanium/mobilesdk/osx/6.2.2.GA\r\n Target Platform = android", "closedSprints": [ { "id": 978, "state": "closed", "name": "2017 Sprint 25 SDK", "startDate": "2017-12-03T23:22:15.144Z", "endDate": "2017-12-17T23:22:00.000Z", "completeDate": "2017-12-18T22:32:02.770Z", "originBoardId": 114 }, { "id": 968, "state": "closed", "name": "2017 Sprint 23 SDK", "startDate": "2017-11-05T16:37:25.071Z", "endDate": "2017-11-19T16:37:00.000Z", "completeDate": "2017-11-20T18:57:56.565Z", "originBoardId": 114 }, { "id": 984, "state": "closed", "name": "2017 Sprint 26 SDK", "startDate": "2017-12-17T22:34:59.726Z", "endDate": "2017-12-31T22:34:00.000Z", "completeDate": "2018-01-02T16:57:05.655Z", "originBoardId": 114 }, { "id": 985, "state": "closed", "name": "2018 Sprint 01 SDK", "startDate": "2017-12-31T16:58:54.631Z", "endDate": "2018-01-14T16:58:00.000Z", "completeDate": "2018-01-17T22:44:27.028Z", "originBoardId": 114 }, { "id": 990, "state": "closed", "name": "2018 Sprint 02 SDK", "startDate": "2018-01-14T22:48:43.544Z", "endDate": "2018-01-28T22:48:00.000Z", "completeDate": "2018-01-29T16:22:42.911Z", "originBoardId": 114 }, { "id": 975, "state": "closed", "name": "2017 Sprint 24 SDK", "startDate": "2017-11-19T18:59:24.352Z", "endDate": "2017-12-03T18:59:00.000Z", "completeDate": "2017-12-04T23:20:14.151Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "428808", "author": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FYI, attaching the listview, its sections, or list items to windows object, or anything does not really help to solve the crash at all. This seems to be an internal bug related to the native titanium sdk.", "updateAuthor": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-07T06:40:59.000+0000", "updated": "2017-10-07T06:40:59.000+0000" }, { "id": "430247", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, This only happens in limited memory? Can you check for memory leaks? Thanks. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-11-07T22:17:20.000+0000", "updated": "2017-11-11T16:22:33.000+0000" }, { "id": "430340", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~spaceman12],\r\n\r\nDid you manage to to check memory leaks?\r\n\r\nBest", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-09T06:39:40.000+0000", "updated": "2017-11-09T06:39:40.000+0000" }, { "id": "430457", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~spaceman12],\r\n\r\nI just wanted to follow up here. Did you manage to follow the instructions provided earlier? Let us know if you still experience any issue. We would be happy to assist you.\r\nBest Regards!", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-12T05:11:02.000+0000", "updated": "2017-11-12T05:11:02.000+0000" }, { "id": "430458", "author": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nI can assure you there is nothing as like memory leak in our code. You are right that this crash occurs in limited memory environment as I have clearly mention that in the post as well that the crash occurs only right after the GC.\r\n\r\nIt looks like the list view items created with js are cleared up along with the GC and hence triggered the crash when trying to scroll down the list as the error of the crash report is due to trying to access the array iterator method on a null object which is probably our list view items.\r\n\r\nSo for phone with limited memories, the rate at which the object are GCed are more rapid, and hence crashes occurs more prominently. As we are building a big app with image intensive usage pattern, we are forced to abondon titatium for this project and shift to the pure native mode.", "updateAuthor": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-12T05:44:50.000+0000", "updated": "2017-11-12T05:55:46.000+0000" }, { "id": "430532", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This looks like an issue with an ImageView whose source image comes from an Internet URL. It appears to be a race condition that can happen when the ImageView is scrolled offscreen before the image finishes downloading or errors out. It's probably more likely to happen with a slow Internet connection.\r\n\r\nThe Java stacktrace provided shows what needs to be fixed (thanks!). It's definitely a bug on our end. I think doing a \"blind fix\" for this issue is fine in this case since it's difficult to reproduce.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-13T19:05:46.000+0000", "updated": "2017-11-13T19:05:46.000+0000" }, { "id": "430579", "author": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Joshua - you are right. This bug is not just limited to listview alone but to all other views container as well, cause the crash still occurs with scroll view as well. So, I also now belive that this has got to do with image view with remote source images.\nThanks ", "updateAuthor": { "name": "spaceman12", "key": "spaceman12", "displayName": "Lee phela", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-14T07:48:11.000+0000", "updated": "2017-11-14T07:48:11.000+0000" }, { "id": "430741", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9605", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T22:02:12.000+0000", "updated": "2017-11-15T22:02:12.000+0000" }, { "id": "432881", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "7_0_X: https://github.com/appcelerator/titanium_mobile/pull/9708", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-09T00:09:30.000+0000", "updated": "2018-01-09T00:09:30.000+0000" }, { "id": "433323", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\n\r\nMaster PR merged.\r\nWaiting for merge to get enabled for backport.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-19T00:14:06.000+0000", "updated": "2018-01-19T00:14:06.000+0000" }, { "id": "433607", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backport PR merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-24T21:20:29.000+0000", "updated": "2018-01-24T21:20:29.000+0000" }, { "id": "433633", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix with SDK 7.1.0.v20180124153334 & 7.0.2.v20180124142857.\r\n\r\nClosing.\r\n\r\nStudio Ver: 5.0.0.201712081732\r\nOS Ver: 10.13.2\r\nXcode Ver: Xcode 9.2\r\nAppc NPM: 4.2.11\r\nAppc CLI: 7.0.1\r\nDaemon Ver: 1.0.1\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.10.10\r\nNode Ver: 8.9.1\r\nNPM Ver: 5.5.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ samsung SM-G955U1 — Android 7.0\r\n⇨ google Nexus 5 — Android 6.0.1\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-25T00:07:02.000+0000", "updated": "2018-01-25T00:07:02.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }