Menu

TableView - 64Bit Crashes

2015-09-23
2015-10-19
  • Fabio Manfredini

    I am experiencing random crashes with 64-bit. 32-bit is working fine. Is Anyone experiencing problems in 64-bit ? any idea on whats is happening and how to fix it ? The problem is happening in XE8 and also 10 Seattle.

     
  • Fabio Manfredini

    I think the crashes is related to UITableView, but im not sure if the UITableView is the only source of crashes

     
  • justapps

    justapps - 2015-09-24

    Yes, that is the case. I'm downloading iOS 9.0.1 right now and getting ready to test. I hope Apple did something to fix our issues!

     
  • Allen Chow

    Allen Chow - 2015-09-24

    I've found something interesting :

    Inside the demo Tableview3, when you change from Master view to iPad view, it popups an error !
    After I deleted all the tableview items and create again inside the iPad view, it works in 64bit without crash !

    Then I tried demo Tableview Dynamic, I found that you can't delete all items when you create new items, you should at least first add a new tableview item maunally, don't add a section or add the first tableview item inside the program, then it works in 64bit without crash too !!

    Also for UIPickerview, the same case happened, that means you need to add the first item manually !

    So I think that's the case for all similar components !

    Don't know why should do like that, but at least it works !!

     
    • Fabio Manfredini

      What do you mean "Add Manually" ? You mean adding the item at Design Time ?

       
  • Sebastian Zierer

    I've commited some table bugfixes to svn. Please check out the new version. Unfortunately I can't test this right now on an iOS device, so I hope I didn't break anything.

    There is still an AV when loading the TableView3 Demo, then recompiling the DPF package and then loading the TableViewDemo3 again. I haven't figured out what is going wrong there.

     
  • Sebastian Zierer

    I've commited some table bugfixes to svn. Please check out the new version. Unfortunately I can't test this right now on an iOS device, so I hope I didn't break anything.

    There is still an AV when loading the TableView3 Demo, then recompiling the DPF package and then loading the TableViewDemo3 again. I haven't figured out what is going wrong there.

     
  • Allen Chow

    Allen Chow - 2015-09-26

    But the case that 'it crashed whenever you added new tableitem' still happened

     
  • Fabio Manfredini

    I created a simple project isolating the crash. The project is attached.

    I think the problem occurs when you create or delete Sections and items runtime (i need this because my tableviews are dynamic).

    After the latest revision 1303, it now crashes even if you do not create sections at run-time.

    About the project:
    The program has Two buttons: Load and Load (No Crash)

    The "Load" button crashes de app if you click it multiple times

    The "Load (No Crash)" button does not crash even if you click multiple times (on revision 1301)
    P.S On revision 1303 it will also crash !!

    I think the method ClearAll and Secions.Add and TableItems.Add are somewhat causing memory corruption or AVs. Other stuff may be causing other crahes, but these is the ones that i suspect is the cause of the crashes.

    If you could take a look at my attached project (Its very simple and easy to debug)...

    Regards...

     
  • Sebastian Zierer

    Unfortunately I don't have access to a Mac right now, so I can't test this.

    But I found a very suspicious line in DPF.iOS.UITableViewItems. I replaced the unchecked typecast with an "as". I expect that you'll now get an invalid typecast exception here - if it compiles at all

    procedure TDPFTableItemText.SetText( const Value: string );
    begin
      FText := Value;
    {$IFDEF IOS}
        ( FParent as TTableItem).FModified := True; // SZ: FParent is TTableItemCollection (comment out this line)
    

    Please check out the latest revision from svn.

    Then comment out that line and see what happens.

     

    Last edit: Sebastian Zierer 2015-09-29
    • Fabio Manfredini

      That typecast is indeed invalid because FParent is TTableItemCollection, not TTableItem
      so, its wrong either way (with as or with explicit typecast).

      Commenting that line solves the crashes (i did not test all cases, but seems to have solved most of the tableview crashes).

      I dont know why that line is needed or not because it seems to be working ok with that line commented, but i dont know if it is correct to remove it. Maybe the correct way would be to access the TTableItem some other way ??

       
  • Fabio Manfredini

    I found some more strange things in tableview.. at line 2048 on UITableView, there is a line

    Result := result ;

    I think the correct should be

    Result := Rs;

    Also, before every event call the Rs variable should be initialized with the default value so in case the event hanlder does not fill a value for the variable, it willl assume its default value and not use an uninitialized variable that may contain garbage. (The Result := Rs will return garbage if the variable is not initialized and not set in the event handler)

     

    Last edit: Fabio Manfredini 2015-09-29
  • Babak Yaghoobi

    Babak Yaghoobi - 2015-10-18

    Hi Fabio

    I tested your sample project with lastest SVN source code,
    But I can't see any problem
    Tested on:

    Mac OSX 10.11
    XCode 7.0.1
    iPhone 6s
    iOS 9.0.2

    Regards

     
    • Sebastian Zierer

      That might be because I fixed that already :)

       
  • Babak Yaghoobi

    Babak Yaghoobi - 2015-10-19

    Ohhhh, Thank you very much Sebastian, thats great !

    Regards

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.