Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1593] Listview with many list sections fails/crashes app

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2015-07-04T00:24:37.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage, ios, release-3.4.0
ReporterFederico schroder
AssigneeRadamantis Torres-Lechuga
Created2014-10-21T16:05:17.000+0000
Updated2016-03-08T07:38:04.000+0000

Description

Problem Description Our application has a ListView with 3 ListSections. SOMETIMES the 2nd and/or 3rd list section fail to load. Sometimes it crashes the app. Other times I just see an error in the log and some section doesn't show. Things we see on the log:
[INFO] :   Nymbler(40212,0x54f21a8) malloc: *** error for object 0x7fa6ebf4: incorrect checksum for freed object - object was probably modified after being freed.
[INFO] :   *** set a breakpoint in malloc_error_break to debug
[INFO] :   2014-10-20 16:51:02.585 Nymbler[40212:70b] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2935.137/UITableView.m:1368

[INFO] :   2014-10-21 12:47:43.571 Nymbler[14590:118571] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-3318/UITableView.m:1582
Works fine on android, fails on ios 7 & 8. Tested on SDK 3.4.0.b54c467, latest alloy version. Didn't have this problem with 3.3.0 and ios 7. Example app code:
<Alloy>
  <Model src="nameinfo" instance="true" id="nameInfoModel" />
  <Collection src="name" instance="true" id="variationsNames"></Collection>
  <Collection src="name" instance="true" id="similarPopularityNames"></Collection>
  <Collection src="name" instance="true" id="likedNames"></Collection>
  <Window title="{name}" onOpen="onOpenWindow" onClose="onCloseWindow" barColor="{genderColor}" theme="Theme.Nymbler">
    <!-- using $model (name) -->
    <ScrollView class="main" id="mainScroll">
...
...
      <ListView defaultItemTemplate="nametemplate">
        <Templates>
          <ItemTemplate name="nametemplate" height="55">
            <View class="nameContainer bigNameContainer">
              <Label bindId="name" class="name centerName" onClick="goToNameInfo" />
              <ImageView bindId="addInspiration" class="inspiration addInspiration" onClick="addInspiration" />
              <ImageView bindId="removeInspiration" class="inspiration removeInspiration" onClick="removeInspiration" />
            </View>
          </ItemTemplate>
        </Templates>
        <ListSection dataCollection="$.variationsNames" dataTransform="transformName" headerTitle="Variations">
          <HeaderView>
            <View>
              <Label class="listHeaderText" text="{$.nameInfoModel.titleSimilar}"></Label>
            </View>
          </HeaderView>
          <Require src="includes/nameitem" />
        </ListSection>
        <ListSection dataCollection="$.similarPopularityNames" dataTransform="transformName" headerTitle="Similar popularity">
          <HeaderView>
            <View>
              <Label class="listHeaderText" text="{$.nameInfoModel.titlePopular}"></Label>
            </View>
          </HeaderView>
          <Require src="includes/nameitem" />
        </ListSection>
        <ListSection dataCollection="$.likedNames" dataTransform="transformName">
          <HeaderView>
            <View>
              <Label class="listHeaderText" text="{$.nameInfoModel.titleLiked}"></Label>
            </View>
          </HeaderView>
          <Require src="includes/nameitem" />
        </ListSection>
      </ListView>
      <View id="adBottomContainer" class="adContainer"></View>
    </ScrollView>
  </Window>
</Alloy>

Comments

  1. Mauro Parra-Miranda 2014-10-21

    Hello [~fschroder@runway10.com], Please generate a self contained classic titanium testcase that shows the behavior. We will investigate in parallel, but right now you are the expert on this issue, so maybe you will be faster in finding a small testcase that reproduces the issue. Best Regards, Mauro
  2. Federico schroder 2014-11-21

    I've managed to produce a rather dirty, alloy based use case out of our app. It even includes a remote call, which likely won't make any difference, but I wanted to make sure you have something to reproduce it. Just click test & back a few times and you will see the error. At least on an iphone5s using ios8. To provide a full working example I created a full project which you can get here: https://dl.dropboxusercontent.com/u/1376664/ListSectionTestAlloy.zip Hope it helps
  3. Pedro Henrique Atanásio e Silva 2014-11-24

    I'm facing the same problem in a very similar situation. It makes SDK 3.4.0 unusable in my case as the app crashes constantly. In SDK 3.3.0 it works fine.
  4. Simon R 2015-01-09

    Also seeing this problem. In my app I have two ListSections, both populated from the same collection (with different filters), interestingly when one of the sections is empty this works fine. When there are items in both sections the app may crash with the same error as above – if it does manage to render and not crash, the listview is wrong in two ways: 1. The headers aren't sticky 2. The data binding is broken and the items never update If I run the app using Xcode there's a consistent crash on line 139 of Classes/TiListViewProxy.m:
       
       #138 block(tableView);
       #139 [tableView endUpdates]; // Thread 1: EXC_BAD_ACCESS (code=2, address=0x########)
       #140 Block_release(block);
       
       
    Related commit: https://github.com/appcelerator/titanium_mobile/commit/bd92fb8e19697e4bd89a20865750b7cd9e9134d0

JSON Source