Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13370] Android: TableView crashes with ConcurrentModificationException when firing scrollend event

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-04-08T20:38:08.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 07 API, 2013 Sprint 07, Release 3.2.0
ComponentsAndroid
Labelsmodule_tableview, qe-testadded, regression, triage
ReporterPedro Enrique
AssigneeHieu Pham
Created2013-04-04T19:14:37.000+0000
Updated2014-02-21T01:38:34.000+0000

Description

Description

The following code will make the app crash after scrolling all the way to the bottom and back up. Sometimes it crashes earlier. Another thing that happens is a JS error pops up as shown in this image: http://f.cl.ly/items/3e3i103A0W0y3S3Z3S1B/image001.png All this happened after the fix for bug TIMOB-13055
var win = Ti.UI.createWindow({
    backgroundColor: '#ffffff'
});

var tableData = [];
var x = 0;
for(var i = 0; i < 10; i++) {
    // Create 10 sections
    var section = Ti.UI.createTableViewSection({
        font: {
            fontSize: '14dp'
        },
        headerTitle: 'Pretty Section #' + (i+1),
        color: 'white'
    });
    // Create 10 rows and add them to the section
    for(var o = 0; o < 10; o++) {
        var avatar = Ti.UI.createImageView({
            image: 'KS_nav_ui.png',
            width: '64dp',
            height: '64dp',
            left: '0dp',
            top: '0dp'
        });
        x++;
        var title = Ti.UI.createLabel({
            left: '70dp',
            top: '5dp',
            height: Ti.UI.SIZE,
            font: {
                fontSize: '18dp'
            },
            color: 'black',
            text: 'Row number is ' + (o+1)
        });
        var subtitle = Ti.UI.createLabel({
            left: '70dp',
            top: '30dp',
            height: Ti.UI.SIZE,
            font: {
                fontSize: '14dp'
            },
            color: 'black',
            text: 'Section is ' + (i+1)
        });
        var row = Ti.UI.createTableViewRow({
            height: '64dp',
            className: 'choppy_tableview'
        });
        row.add(avatar);
        row.add(title);
        row.add(subtitle);
        section.add(row);
    }
    tableData.push(section);
}
// Create the table view
var table = Ti.UI.createTableView({
    data: tableData
});

table.addEventListener('click', function(){
	
});

table.addEventListener('scroll', function(){
	
});


win.add(table);

win.open();

Stack trace:

04-04 14:09:03.784: E/TiApplication(10959): (main) [11968,11968] Sending event: exception on thread: main msg:java.util.ConcurrentModificationException; Titanium 3.1.0,2013/04/02 15:41,1b76dea
04-04 14:09:03.784: E/TiApplication(10959): java.util.ConcurrentModificationException
04-04 14:09:03.784: E/TiApplication(10959):          at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
04-04 14:09:03.784: E/TiApplication(10959):          at java.util.HashMap$EntryIterator.next(HashMap.java:833)
04-04 14:09:03.784: E/TiApplication(10959):          at java.util.HashMap$EntryIterator.next(HashMap.java:831)
04-04 14:09:03.784: E/TiApplication(10959):          at java.util.HashMap.constructorPutAll(HashMap.java:209)
04-04 14:09:03.784: E/TiApplication(10959):          at java.util.HashMap.<init>(HashMap.java:200)
04-04 14:09:03.784: E/TiApplication(10959):          at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79)
04-04 14:09:03.784: E/TiApplication(10959):          at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156)
04-04 14:09:03.784: E/TiApplication(10959):          at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818)
04-04 14:09:03.784: E/TiApplication(10959):          at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306)
04-04 14:09:03.784: E/TiApplication(10959):          at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253)
04-04 14:09:03.784: E/TiApplication(10959):          at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323)
04-04 14:09:03.784: E/TiApplication(10959):          at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392)
04-04 14:09:03.784: E/TiApplication(10959):          at android.os.Handler.handleCallback(Handler.java:587)
04-04 14:09:03.784: E/TiApplication(10959):          at android.os.Handler.dispatchMessage(Handler.java:92)
04-04 14:09:03.784: E/TiApplication(10959):          at android.os.Looper.loop(Looper.java:130)
04-04 14:09:03.784: E/TiApplication(10959):          at android.app.ActivityThread.main(ActivityThread.java:3691)
04-04 14:09:03.784: E/TiApplication(10959):          at java.lang.reflect.Method.invokeNative(Native Method)
04-04 14:09:03.784: E/TiApplication(10959):          at java.lang.reflect.Method.invoke(Method.java:507)
04-04 14:09:03.784: E/TiApplication(10959):          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
04-04 14:09:03.784: E/TiApplication(10959):          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
04-04 14:09:03.784: E/TiApplication(10959):          at dalvik.system.NativeStart.main(Native Method)
04-04 14:09:03.854: E/(134): Dumpstate > /data/log/dumpstate_app_error
04-04 14:09:03.854: E/AndroidRuntime(10959): FATAL EXCEPTION: main
04-04 14:09:03.854: E/AndroidRuntime(10959): java.util.ConcurrentModificationException
04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:833)
04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:831)
04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap.constructorPutAll(HashMap.java:209)
04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap.<init>(HashMap.java:200)
04-04 14:09:03.854: E/AndroidRuntime(10959): at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79)
04-04 14:09:03.854: E/AndroidRuntime(10959): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156)
04-04 14:09:03.854: E/AndroidRuntime(10959): at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818)
04-04 14:09:03.854: E/AndroidRuntime(10959): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306)
04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253)
04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323)
04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392)
04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Handler.handleCallback(Handler.java:587)
04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Handler.dispatchMessage(Handler.java:92)
04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Looper.loop(Looper.java:130)
04-04 14:09:03.854: E/AndroidRuntime(10959): at android.app.ActivityThread.main(ActivityThread.java:3691)
04-04 14:09:03.854: E/AndroidRuntime(10959): at java.lang.reflect.Method.invokeNative(Native Method)
04-04 14:09:03.854: E/AndroidRuntime(10959): at java.lang.reflect.Method.invoke(Method.java:507)
04-04 14:09:03.854: E/AndroidRuntime(10959): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
04-04 14:09:03.854: E/AndroidRuntime(10959): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
04-04 14:09:03.854: E/AndroidRuntime(10959): at dalvik.system.NativeStart.main(Native Method)

Comments

  1. Pedro Enrique 2013-04-04

    Another one from the same issue
       04-04 08:36:19.564: W/System.err(8316): java.lang.NullPointerException
       04-04 08:36:19.564: W/System.err(8316):              at ti.modules.titanium.ui.TableViewRowProxy.fireEvent(TableViewRowProxy.java:207)
       04-04 08:36:19.564: W/System.err(8316):              at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818)
       04-04 08:36:19.564: W/System.err(8316):              at org.appcelerator.kroll.KrollProxy.fireEventToParent(KrollProxy.java:715)
       04-04 08:36:19.564: W/System.err(8316):              at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
       04-04 08:36:19.564: W/System.err(8316):              at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64)
       04-04 08:36:19.564: W/System.err(8316):              at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:819)
       04-04 08:36:19.564: W/System.err(8316):              at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1043)
       04-04 08:36:19.564: W/System.err(8316):              at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:316)
       04-04 08:36:19.564: W/System.err(8316):              at android.os.Handler.dispatchMessage(Handler.java:95)
       04-04 08:36:19.564: W/System.err(8316):              at android.os.Looper.loop(Looper.java:130)
       04-04 08:36:19.564: W/System.err(8316):              at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
       04-04 08:36:19.604: E/TiExceptionHandler(8316): (main) [202,6299] ----- Titanium Javascript Runtime Error -----
       04-04 08:36:19.604: E/TiExceptionHandler(8316): (main) [1,6300] - In ti:/events.js:94,20
       04-04 08:36:19.604: E/TiExceptionHandler(8316): (main) [0,6300] - Message: Uncaught Error: Java Exception occurred
       04-04 08:36:19.604: E/TiExceptionHandler(8316): (main) [0,6300] - Source:                                                            handled = this._fireEventToParent(type, data);
       04-04 08:36:19.644: E/V8Exception(8316): Exception occurred at ti:/events.js:94: Uncaught Error: Java Exception occurred
       
  2. Ping Wang 2013-04-04

    The NPE reported above should be fixed by [PR#4078](https://github.com/appcelerator/titanium_mobile/pull/4078) and [3_1_X PR#4079](https://github.com/appcelerator/titanium_mobile/pull/4079). Ran the test case using the latest master and 3_1_X branch on Nexus 7 (4.1), Galaxy Nexus (4.0.4) and HTC Sensation 4G (2.3.4). Cannot reproduce the crash.
  3. Darren Haligas 2013-04-05

    This is not resolved. I tested with the build from 3.1.0.v20130404173046 and my app is crashing. You have to scroll to the bottom of the list and scroll fast and then scroll back up a few times. It will happen. 3.1 will be unusable if this is not fixed. The PR above fixes the ti:/events.js error but not the scrolling error.
  4. Ping Wang 2013-04-05

    Hi Darren, I just used the build 3.1.0.v20130404173046 to test the test case attached in the ticket and it works fine without any crash. Can you post your test app, the crash log and on what device you tested? Thanks.
  5. Darren Haligas 2013-04-05

    Samsung-SGH-I927 Android 2.3.5 var win = Ti.UI.createWindow({ backgroundColor: '#ffffff' }); var tableData = []; var x = 0; for(var i = 0; i < 10; i++) { // Create 10 sections var section = Ti.UI.createTableViewSection({ font: { fontSize: '14dp' }, headerTitle: 'Pretty Section #' + (i+1), color: 'white' }); // Create 10 rows and add them to the section for(var o = 0; o < 10; o++) { x++; var title = Ti.UI.createLabel({ left: '70dp', top: '5dp', height: Ti.UI.SIZE, font: { fontSize: '18dp' }, color: 'black', text: 'Row number is ' + (o+1) }); var subtitle = Ti.UI.createLabel({ left: '70dp', top: '30dp', height: Ti.UI.SIZE, font: { fontSize: '14dp' }, color: 'black', text: 'Section is ' + (i+1) }); var row = Ti.UI.createTableViewRow({ height: '64dp', className: 'choppy_tableview' }); row.add(title); row.add(subtitle); section.add(row); } tableData.push(section); } // Create the table view var table = Ti.UI.createTableView({ data: tableData }); table.addEventListener('click', function(){ }); win.add(table); win.open(); 04-05 14:41:56.594: W/dalvikvm(21111): threadid=1: thread exiting with uncaught exception (group=0x40192578) 04-05 14:41:56.594: E/TiApplication(21111): (main) [5739,5739] Sending event: exception on thread: main msg:java.util.ConcurrentModificationException; Titanium 3.1.0,2013/04/04 17:31,d30814c 04-05 14:41:56.594: E/TiApplication(21111): java.util.ConcurrentModificationException 04-05 14:41:56.594: E/TiApplication(21111): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) 04-05 14:41:56.594: E/TiApplication(21111): at java.util.HashMap$EntryIterator.next(HashMap.java:833) 04-05 14:41:56.594: E/TiApplication(21111): at java.util.HashMap$EntryIterator.next(HashMap.java:831) 04-05 14:41:56.594: E/TiApplication(21111): at java.util.HashMap.constructorPutAll(HashMap.java:209) 04-05 14:41:56.594: E/TiApplication(21111): at java.util.HashMap.(HashMap.java:200) 04-05 14:41:56.594: E/TiApplication(21111): at org.appcelerator.kroll.KrollDict.(KrollDict.java:79) 04-05 14:41:56.594: E/TiApplication(21111): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156) 04-05 14:41:56.594: E/TiApplication(21111): at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818) 04-05 14:41:56.594: E/TiApplication(21111): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) 04-05 14:41:56.594: E/TiApplication(21111): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) 04-05 14:41:56.594: E/TiApplication(21111): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) 04-05 14:41:56.594: E/TiApplication(21111): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) 04-05 14:41:56.594: E/TiApplication(21111): at android.os.Handler.handleCallback(Handler.java:587) 04-05 14:41:56.594: E/TiApplication(21111): at android.os.Handler.dispatchMessage(Handler.java:92) 04-05 14:41:56.594: E/TiApplication(21111): at android.os.Looper.loop(Looper.java:130) 04-05 14:41:56.594: E/TiApplication(21111): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-05 14:41:56.594: E/TiApplication(21111): at java.lang.reflect.Method.invokeNative(Native Method) 04-05 14:41:56.594: E/TiApplication(21111): at java.lang.reflect.Method.invoke(Method.java:507) 04-05 14:41:56.594: E/TiApplication(21111): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-05 14:41:56.594: E/TiApplication(21111): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-05 14:41:56.594: E/TiApplication(21111): at dalvik.system.NativeStart.main(Native Method) 04-05 14:41:56.664: D/dalvikvm(21111): GC_CONCURRENT freed 1183K, 43% free 4441K/7751K, external 3648K/3818K, paused 3ms+5ms 04-05 14:41:56.684: E/AndroidRuntime(21111): FATAL EXCEPTION: main 04-05 14:41:56.684: E/AndroidRuntime(21111): java.util.ConcurrentModificationException 04-05 14:41:56.684: E/AndroidRuntime(21111): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) 04-05 14:41:56.684: E/AndroidRuntime(21111): at java.util.HashMap$EntryIterator.next(HashMap.java:833) 04-05 14:41:56.684: E/AndroidRuntime(21111): at java.util.HashMap$EntryIterator.next(HashMap.java:831) 04-05 14:41:56.684: E/AndroidRuntime(21111): at java.util.HashMap.constructorPutAll(HashMap.java:209) 04-05 14:41:56.684: E/AndroidRuntime(21111): at java.util.HashMap.(HashMap.java:200) 04-05 14:41:56.684: E/AndroidRuntime(21111): at org.appcelerator.kroll.KrollDict.(KrollDict.java:79) 04-05 14:41:56.684: E/AndroidRuntime(21111): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156) 04-05 14:41:56.684: E/AndroidRuntime(21111): at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818) 04-05 14:41:56.684: E/AndroidRuntime(21111): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) 04-05 14:41:56.684: E/AndroidRuntime(21111): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) 04-05 14:41:56.684: E/AndroidRuntime(21111): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) 04-05 14:41:56.684: E/AndroidRuntime(21111): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) 04-05 14:41:56.684: E/AndroidRuntime(21111): at android.os.Handler.handleCallback(Handler.java:587) 04-05 14:41:56.684: E/AndroidRuntime(21111): at android.os.Handler.dispatchMessage(Handler.java:92) 04-05 14:41:56.684: E/AndroidRuntime(21111): at android.os.Looper.loop(Looper.java:130) 04-05 14:41:56.684: E/AndroidRuntime(21111): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-05 14:41:56.684: E/AndroidRuntime(21111): at java.lang.reflect.Method.invokeNative(Native Method) 04-05 14:41:56.684: E/AndroidRuntime(21111): at java.lang.reflect.Method.invoke(Method.java:507) 04-05 14:41:56.684: E/AndroidRuntime(21111): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-05 14:41:56.684: E/AndroidRuntime(21111): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-05 14:41:56.684: E/AndroidRuntime(21111): at dalvik.system.NativeStart.main(Native Method) 04-05 14:41:56.694: E/(134): Dumpstate > /data/log/dumpstate_app_error
  6. Darren Haligas 2013-04-05

    I was able to reproduce this by scrolling up and down fast. This started happening after this commit I think https://github.com/appcelerator/titanium_mobile/commit/830727f5d65bf596e811fbbaaf1198c2517d35cf
  7. Darren Haligas 2013-04-05

    You can see that this line below is getting called multiple times and the HashMap is not locked or thread safe which appears to cause the exception 04-05 14:41:56.594: E/TiApplication(21111): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306)
  8. Ping Wang 2013-04-05

    The crash can be easily reproduced on Nexus 7 (4.1). PR: https://github.com/appcelerator/titanium_mobile/pull/4110 3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4111
  9. Shyam Bhadauria 2013-04-06

    Environment used for verification - Titanium SDK: 3.1.0.v20130405170202 Titanium  Studio:3.1.0.201304011603 Device: Samsung GALAXY Note (2.3.6) and Nexus 7 Android 4.1
  10. Darren Haligas 2013-04-08

    This still has not been resolved. I was able to reproduce this error with 3.1.0.v20130405170202 Device Samsung SGH (2.3.5). As you can see from the stack trace below the build is from Friday. 04-07 23:29:04.710: E/TiApplication(1797): (main) [17296,47643] Sending event: exception on thread: main msg:java.util.ConcurrentModificationException; Titanium 3.1.0,2013/04/05 17:02,93d78f5 04-07 23:29:04.710: E/TiApplication(1797): java.util.ConcurrentModificationException 04-07 23:29:04.710: E/TiApplication(1797): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) 04-07 23:29:04.710: E/TiApplication(1797): at java.util.HashMap$EntryIterator.next(HashMap.java:833) 04-07 23:29:04.710: E/TiApplication(1797): at java.util.HashMap$EntryIterator.next(HashMap.java:831) 04-07 23:29:04.710: E/TiApplication(1797): at java.util.HashMap.constructorPutAll(HashMap.java:209) 04-07 23:29:04.710: E/TiApplication(1797): at java.util.HashMap.(HashMap.java:200) 04-07 23:29:04.710: E/TiApplication(1797): at org.appcelerator.kroll.KrollDict.(KrollDict.java:79) 04-07 23:29:04.710: E/TiApplication(1797): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) 04-07 23:29:04.710: E/TiApplication(1797): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) 04-07 23:29:04.710: E/TiApplication(1797): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) 04-07 23:29:04.710: E/TiApplication(1797): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) 04-07 23:29:04.710: E/TiApplication(1797): at android.os.Handler.handleCallback(Handler.java:587) 04-07 23:29:04.710: E/TiApplication(1797): at android.os.Handler.dispatchMessage(Handler.java:92) 04-07 23:29:04.710: E/TiApplication(1797): at android.os.Looper.loop(Looper.java:130) 04-07 23:29:04.710: E/TiApplication(1797): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-07 23:29:04.710: E/TiApplication(1797): at java.lang.reflect.Method.invokeNative(Native Method) 04-07 23:29:04.710: E/TiApplication(1797): at java.lang.reflect.Method.invoke(Method.java:507) 04-07 23:29:04.710: E/TiApplication(1797): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-07 23:29:04.710: E/TiApplication(1797): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-07 23:29:04.710: E/TiApplication(1797): at dalvik.system.NativeStart.main(Native Method)
  11. Darren Haligas 2013-04-08

    You need to scroll up and down to reproduce this error. You might have to a scroll a bunch I can reproduce it every time.
  12. Shyam Bhadauria 2013-04-08

    Still could not reproduce with following env. and devices(scrolled up and down around a dozen times) SDK: 3.1.0.v20130405170202 Studio:3.1.0.201304011603 CLI ver - 3.1.0 Device: Samsung GALAXY Note (2.3.6),Nexus 7 Android 4.1,Samsung Galaxy Nexus Android 4.0.2 and HTC Desire V Android 4.0.3. @Darren - If you could please specify the device on which you are able to reproduce the bug.
  13. Darren Haligas 2013-04-08

    Shyam I am using Samsung-SGH-I927 (2.3.5) AT&T. Every app I have crashes on the table view now. Makes 3.1 unusable if this is not fixed. 04-08 08:57:20.110: E/TiApplication(7877): (main) [38305,118770] Sending event: exception on thread: main msg:java.util.ConcurrentModificationException; Titanium 3.1.0,2013/04/05 17:02,93d78f5 04-08 08:57:20.110: E/TiApplication(7877): java.util.ConcurrentModificationException 04-08 08:57:20.110: E/TiApplication(7877): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) 04-08 08:57:20.110: E/TiApplication(7877): at java.util.HashMap$EntryIterator.next(HashMap.java:833) 04-08 08:57:20.110: E/TiApplication(7877): at java.util.HashMap$EntryIterator.next(HashMap.java:831) 04-08 08:57:20.110: E/TiApplication(7877): at java.util.HashMap.constructorPutAll(HashMap.java:209) 04-08 08:57:20.110: E/TiApplication(7877): at java.util.HashMap.(HashMap.java:200) 04-08 08:57:20.110: E/TiApplication(7877): at org.appcelerator.kroll.KrollDict.(KrollDict.java:79) 04-08 08:57:20.110: E/TiApplication(7877): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) 04-08 08:57:20.110: E/TiApplication(7877): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) 04-08 08:57:20.110: E/TiApplication(7877): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) 04-08 08:57:20.110: E/TiApplication(7877): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) 04-08 08:57:20.110: E/TiApplication(7877): at android.os.Handler.handleCallback(Handler.java:587) 04-08 08:57:20.110: E/TiApplication(7877): at android.os.Handler.dispatchMessage(Handler.java:92) 04-08 08:57:20.110: E/TiApplication(7877): at android.os.Looper.loop(Looper.java:130) 04-08 08:57:20.110: E/TiApplication(7877): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-08 08:57:20.110: E/TiApplication(7877): at java.lang.reflect.Method.invokeNative(Native Method) 04-08 08:57:20.110: E/TiApplication(7877): at java.lang.reflect.Method.invoke(Method.java:507) 04-08 08:57:20.110: E/TiApplication(7877): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-08 08:57:20.110: E/TiApplication(7877): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-08 08:57:20.110: E/TiApplication(7877): at dalvik.system.NativeStart.main(Native Method)
  14. Darren Haligas 2013-04-08

    The latest kitchen sink from github crashes after just a few scrolls in the first list
  15. Ingo Muschenetz 2013-04-08

    [~vduggal] Believes he knows what is going on.
  16. Vishal Duggal 2013-04-08

    https://github.com/appcelerator/titanium_mobile/pull/4122 https://github.com/appcelerator/titanium_mobile/pull/4123
  17. Darren Haligas 2013-04-08

    Vishal how is your change different than before?
  18. Vishal Duggal 2013-04-08

    We can not reproduce the error you are seeing. I am basically working off the theory that the first event gets the message onto the runtime thread, the runtime thread is paused for the UI thread where we are trying to fire the second event and it is trying to create a new dictionary for the second event and hence the ConcurrentModificationException. My PR basically creates a copy of the dictionary before firing off the event so the above scenario will not occur.
  19. Darren Haligas 2013-04-08

    Why are there 2 scroll end events being fired?
  20. Vishal Duggal 2013-04-08

    scrollend and scrollEnd(deprecated but still supported)
  21. Darren Haligas 2013-04-08

    ok I will test as soon as it makes it to the continuous builds
  22. Allen Yeung 2013-04-08

    Merged the PR, and resolving for now. Please test this and reopen if you are still seeing the error.
  23. Darren Haligas 2013-04-08

    Appears to have been fixed! Thanks!
  24. Paras Mishra 2013-04-09

    App is running fine as TableView doesn't crashes. Verified on: SDK: 3.1.0.v20130408154547 CLI version : 3.1.0-cr OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.0.201304052347 XCode : 4.5.1

JSON Source