java.lang.RuntimeException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • {html}<div><p>In StatusNet Mobile we've been working with a lot of event listeners, including Ti.App listeners for communication between our primary context, another context to run XML parsing in the background, and a WebView used for various data display.</p> <p>Sometimes we end up with cases where things quite reliably crash the VM dumping a raw C-level stacktrace that can be worked around temporarily by shuffling when/where we do an addEventListener, but I'm also seeing more intermittent bugs where I get a Java-level backtrace like this:</p> <pre> <code>W/dalvikvm( 1759): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0) E/TiUncaughtHandler( 1759): (main) [43,123166] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to destroy activity {net.status.client.mobile/org.appcelerator.titanium.TiActivity}: java.util.ConcurrentModificationException E/TiUncaughtHandler( 1759): java.lang.RuntimeException: Unable to destroy activity {net.status.client.mobile/org.appcelerator.titanium.TiActivity}: java.util.ConcurrentModificationException E/TiUncaughtHandler( 1759): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3655) E/TiUncaughtHandler( 1759): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3673) E/TiUncaughtHandler( 1759): at android.app.ActivityThread.access$2900(ActivityThread.java:125) E/TiUncaughtHandler( 1759): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) E/TiUncaughtHandler( 1759): at android.os.Handler.dispatchMessage(Handler.java:99) E/TiUncaughtHandler( 1759): at android.os.Looper.loop(Looper.java:123) E/TiUncaughtHandler( 1759): at android.app.ActivityThread.main(ActivityThread.java:4627) E/TiUncaughtHandler( 1759): at java.lang.reflect.Method.invokeNative(Native Method) E/TiUncaughtHandler( 1759): at java.lang.reflect.Method.invoke(Method.java:521) E/TiUncaughtHandler( 1759): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) E/TiUncaughtHandler( 1759): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) E/TiUncaughtHandler( 1759): at dalvik.system.NativeStart.main(Native Method) E/TiUncaughtHandler( 1759): Caused by: java.util.ConcurrentModificationException E/TiUncaughtHandler( 1759): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:795) E/TiUncaughtHandler( 1759): at java.util.HashMap$KeyIterator.next(HashMap.java:822) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiContext.removeEventListenersFromContext(TiContext.java:468) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiProxy.removeEventListenersFromContext(TiProxy.java:242) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiApplication.removeEventListenersFromContext(TiApplication.java:275) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiContext.release(TiContext.java:879) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:415) E/TiUncaughtHandler( 1759): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3642) E/TiUncaughtHandler( 1759): ... 11 more</code> </pre> <p>It looks like there's a lot of unsynchronized access to the event listener hashmaps in TiContext; there's a few synchronized(eventListeners){...} constructs but they're not consistent, and I'm not too sure what does what.</p></div>{html}
    via by Brion Vibber,
  • {html}<div><p>In StatusNet Mobile we've been working with a lot of event listeners, including Ti.App listeners for communication between our primary context, another context to run XML parsing in the background, and a WebView used for various data display.</p> <p>Sometimes we end up with cases where things quite reliably crash the VM dumping a raw C-level stacktrace that can be worked around temporarily by shuffling when/where we do an addEventListener, but I'm also seeing more intermittent bugs where I get a Java-level backtrace like this:</p> <pre> <code>W/dalvikvm( 1759): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0) E/TiUncaughtHandler( 1759): (main) [43,123166] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to destroy activity {net.status.client.mobile/org.appcelerator.titanium.TiActivity}: java.util.ConcurrentModificationException E/TiUncaughtHandler( 1759): java.lang.RuntimeException: Unable to destroy activity {net.status.client.mobile/org.appcelerator.titanium.TiActivity}: java.util.ConcurrentModificationException E/TiUncaughtHandler( 1759): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3655) E/TiUncaughtHandler( 1759): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3673) E/TiUncaughtHandler( 1759): at android.app.ActivityThread.access$2900(ActivityThread.java:125) E/TiUncaughtHandler( 1759): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) E/TiUncaughtHandler( 1759): at android.os.Handler.dispatchMessage(Handler.java:99) E/TiUncaughtHandler( 1759): at android.os.Looper.loop(Looper.java:123) E/TiUncaughtHandler( 1759): at android.app.ActivityThread.main(ActivityThread.java:4627) E/TiUncaughtHandler( 1759): at java.lang.reflect.Method.invokeNative(Native Method) E/TiUncaughtHandler( 1759): at java.lang.reflect.Method.invoke(Method.java:521) E/TiUncaughtHandler( 1759): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) E/TiUncaughtHandler( 1759): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) E/TiUncaughtHandler( 1759): at dalvik.system.NativeStart.main(Native Method) E/TiUncaughtHandler( 1759): Caused by: java.util.ConcurrentModificationException E/TiUncaughtHandler( 1759): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:795) E/TiUncaughtHandler( 1759): at java.util.HashMap$KeyIterator.next(HashMap.java:822) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiContext.removeEventListenersFromContext(TiContext.java:468) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiProxy.removeEventListenersFromContext(TiProxy.java:242) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiApplication.removeEventListenersFromContext(TiApplication.java:275) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiContext.release(TiContext.java:879) E/TiUncaughtHandler( 1759): at org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:415) E/TiUncaughtHandler( 1759): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3642) E/TiUncaughtHandler( 1759): ... 11 more</code> </pre> <p>It looks like there's a lot of unsynchronized access to the event listener hashmaps in TiContext; there's a few synchronized(eventListeners){...} constructs but they're not consistent, and I'm not too sure what does what.</p></div>{html}
    via by Brion Vibber,
  • Crash in map
    via GitHub by Bananeweizen
    ,
    • java.lang.RuntimeException: Unable to destroy activity {net.status.client.mobile/org.appcelerator.titanium.TiActivity}: java.util.ConcurrentModificationException at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3655) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3673) at android.app.ActivityThread.access$2900(ActivityThread.java:125) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4627) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) at dalvik.system.NativeStart.main(Native Method) Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:795) at java.util.HashMap$KeyIterator.next(HashMap.java:822) at org.appcelerator.titanium.TiContext.removeEventListenersFromContext(TiContext.java:468) at org.appcelerator.titanium.TiProxy.removeEventListenersFromContext(TiProxy.java:242) at org.appcelerator.titanium.TiApplication.removeEventListenersFromContext(TiApplication.java:275) at org.appcelerator.titanium.TiContext.release(TiContext.java:879) at org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:415) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3642)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    iridiciridic
    2 times, last one,
    franky lifranky li
    1 times, last one,
    bpbhat77bpbhat77
    2 times, last one,
    21 more bugmates