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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 !!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)...
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
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 ??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
I think the crashes is related to UITableView, but im not sure if the UITableView is the only source of crashes
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!
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 !!
What do you mean "Add Manually" ? You mean adding the item at Design Time ?
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.
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.
But the case that 'it crashed whenever you added new tableitem' still happened
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...
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
Please check out the latest revision from svn.
Then comment out that line and see what happens.
Last edit: Sebastian Zierer 2015-09-29
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 ??
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
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
That might be because I fixed that already :)
Ohhhh, Thank you very much Sebastian, thats great !
Regards