Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25506

Android: ImageView sometimes crashes when loading via URL


    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 7.0.2
    • Component/s: Android
    • Environment:
    • Story Points:
    • Sprint:
      2017 Sprint 23 SDK, 2017 Sprint 24 SDK, 2017 Sprint 25 SDK, 2017 Sprint 26 SDK, 2018 Sprint 01 SDK, 2018 Sprint 02 SDK


      This bug is so difficult to reproduce.
      However, 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.

      The 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 -

      [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
      [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
      [INFO] : I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1. ()
      [INFO] : I/Adreno-EGL: OpenGL ES Shader Compiler Version: E031.25.03.00
      [INFO] : I/Adreno-EGL: Build Date: 02/11/15 Wed
      [INFO] : I/Adreno-EGL: Local Branch:
      [INFO] : I/Adreno-EGL: Remote Branch: quic/LA.BF.1.1.1_rb1.10
      [INFO] : I/Adreno-EGL: Local Patches: NONE
      [INFO] : I/Adreno-EGL: Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1. + 62ca4eb + acd831d + 9f8b442 + e027a02 + cba30ba + 53c303a + a649d79 + 23e16f8 + 5e97da7 + cbd2a44 + 33d072a + 7aacf06 + 72b33e7 + 28f6f60 + b4c13d8 + NOTHING
      [INFO] : OpenGLRenderer: Initialized EGL, version 1.4

      [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
      [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Iterator java.util.ArrayList.iterator()' on a null object reference
      [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiDownloadManager.handleFireDownloadMessage(TiDownloadManager.java:104)
      [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiDownloadManager.handleMessage(TiDownloadManager.java:174)
      [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:98)
      [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:135)
      [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5343)
      [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method)
      [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:372)
      [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
      [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
      [INFO] : Process: Sending signal. PID: 15484 SIG: 9

      Steps to reproduce [tested on moto G 1st gen phone with 1GB RAM]-
      1. Import the attached zip file to your titanium studio and run it in a system with limited memory.
      2. 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).
      3. 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.
      4. This time the app hangs up and crashes after a few rounds of GC.




            • Assignee:
              gmathews Gary Mathews
              spaceman12 Lee phela
              Joshua Quick
              Lokesh Choudhary
            • Watchers:
              5 Start watching this issue


              • Created:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  Sync status:
                  Last received:
                  Last sent:

                  Git Source Code