Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4282] iOS: KitchenSink unreproducible crash while running Base UI>Views>Table Views>Table Empty AppendRow

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-05-02T20:34:47.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sn/a
ComponentsiOS
LabelsKitchenSink
ReporterEric Merriman
AssigneeIngo Muschenetz
Created2011-06-01T15:13:24.000+0000
Updated2017-05-02T20:34:47.000+0000

Description

Description: While testing KitchenSink, I experienced a crash that seemed to relate to a table append that was out of sync with the contents of the table. I could not reproduce this failure in 5 attempts. Please see the log and console output attached. Steps to reproduce: 1) Unknown, but occurred about 2 hours into testing. Result: Crash Expected Result: No crash Notes: Could not reproduce on 1.6.2 (5 attempts) or 1.7.0 (5 attempts)

Comments

  1. Eduardo Gomez 2011-07-22

    Problem

    A customer has encountered a similar issue. After creating a Table View and opening it a certain number of times, appending rows crashes the app.

    Environment

    {noformat} Product: Mobile Titanium SDK: Mobile 1.7.1 Platform OS: iOS Platform OS Version: 4.2 {noformat}

    Console Log

    [INFO] Application has exited from Simulator

    Reproduction

    Tough to reliably reproduce, although happens most often after a Table view has been added to a window instantiated (url to a JavaScript file).

    Repro sequence

       // this sets the background color of the master UIView (when there are no windows/tab groups on it)
       Titanium.UI.setBackgroundColor('#000');
       
       // create tab group
       var tabGroup = Titanium.UI.createTabGroup();
       
       //
       // create base UI tab and root window
       //
       var win1 = Titanium.UI.createWindow({
           title: 'Tab 1',
           backgroundColor: '#fff',
           url: 'home.js'
       });
       var tab1 = Titanium.UI.createTab({
           icon: 'KS_nav_views.png',
           title: 'Tab 1',
           window: win1
       });
       
       var label1 = Titanium.UI.createLabel({
           color: '#999',
           text: 'I am Window 1',
           font: {
               fontSize: 20,
               fontFamily: 'Helvetica Neue'
           },
           textAlign: 'center',
           width: 'auto'
       });
       
       win1.add(label1);
       
       // create controls tab and root window
       //
       var win2 = Titanium.UI.createWindow({
           title: 'Tab 2',
           backgroundColor: '#fff'
       });
       var tab2 = Titanium.UI.createTab({
           icon: 'KS_nav_ui.png',
           title: 'Tab 2',
           window: win2
       });
       
       var label2 = Titanium.UI.createLabel({
           color: '#999',
           text: 'I am Window 2',
           font: {
               fontSize: 20,
               fontFamily: 'Helvetica Neue'
           },
           textAlign: 'center',
           width: 'auto'
       });
       
       win2.add(label2);
       
       //
       //  add tabs
       //
       tabGroup.addTab(tab1);
       tabGroup.addTab(tab2);
       
       // open tab group
       tabGroup.open();
       
       var viewOpen = Ti.UI.createView({
           backgroundColor: '#009900',
           width: 100,
           height: 40,
           left: 20,
           top: 30
       });
       
       var viewOpen2 = Ti.UI.createView({
           backgroundColor: '#000099',
           width: 100,
           height: 40,
           right: 20,
           top: 30
       });
       
       Ti.UI.currentWindow.add(viewOpen);
       Ti.UI.currentWindow.add(viewOpen2);
       
       var win3 = Ti.UI.createWindow({
           title: 'testing'
       });
       var win4 = Ti.UI.createWindow({
           title: 'testing2',
           url: 'testing2.js'
       });
       
       viewOpen.addEventListener('click', function() {
           var table = createTable();
           win3.add(table);
           Ti.UI.currentTab.open(win3, {
               animated: true
           });
       });
       
       viewOpen2.addEventListener('click', function() {
           Ti.UI.currentTab.open(win4, {
               animated: true
           });
       });
       
       //Actually this function doesn't crash the app
       function createTable() {
           var title;
           var row;
           var data = [];
           var table = Ti.UI.createTableView();
           for (i = 0; i < 100; i++) {
               title = 'I am appended row ' + i.toString();
               row = Ti.UI.createTableViewRow({
                   title: title
               });
               table.appendRow(row);
           }
           return table;
       }
       
       var win = Ti.UI.currentWindow;
       var table = createTable4();
       win.add(table);
       
       win.addEventListener('close', function() {
       //If table is not removed will throw a:
       //[DEBUG] Session did end with error (null)
       //[INFO] Application has exited from Simulator
           win.remove(table);
       });
       
       
       // Up to 25 attempts will crash...
       function createTable() {
           var title;
           var row;
           var data = [];
           for (i = 0; i < 100; i++) {
               title = 'I am row ' + i.toString();
               row = Ti.UI.createTableViewRow({
                   title: title
               });
               data[i] = row;
           }
           var table = Ti.UI.createTableView({
               data: data
           });
           return table;
       }
       
       //Up to 25 attempts will crash...
       function createTable2() {
           var title;
           var row;
           var data = [];
           var i;
           var table = Ti.UI.createTableView();
           for (i = 0; i < 50; i++) {
               
               title = 'I am row ' + i.toString();
               row = Ti.UI.createTableViewRow({
                   title: title
               });
               table.appendRow(row);
               
               //Append Row objects to table makes no difference  
               //table.appendRow(Titanium.UI.createTableViewRow({
               //      title:'I am row ' + i,
               //}));
               
           }//for
           return table;
       }
       
       
       //Up to 15 attempts will crash...
       function createTable3() {
           var title;
           var row;
           var data = [];
           var table = Ti.UI.createTableView();
           for (i = 0; i < 100; i++) {
               title = 'I am row ' + i.toString();
               row = Ti.UI.createTableViewRow({
                   title: title
               });
               data[i] = row;
           }
           table.setData(data);
           return table;
       }
       
       //After 50 attempts didn't crash the app calling it from home.js
       //Up to 2 attempts crashed the app...
       function createTable4() {
           var title;
           var row;
           var data = [];
           var table = Ti.UI.createTableView();
           for (i = 0; i < 100; i++) {
               title = 'I am appended row ' + i.toString();
               row = Ti.UI.createTableViewRow({
                   title: title
               });
               table.appendRow(row);
           }
           return table;
       }
       

    Associated HD ticket

    A PRO customer relies on this
  2. Lee Morris 2017-05-02

    Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.

JSON Source