Hi all:
I'm working on porting the
SLAMM Model (environmental open-source model) from Delphi to Lazarus. I'm very new with Lazarus, though 15 years with Delphi. Need to get the project to 64-bit ASAP so in the process of porting it. (I would put this post in the Delphi "package" forum but this is not a package that I'm working with...)
Having some frustration with a few errors that I can't debug myself. I'm a bit shy of using the Bugtracker due to my inexperience with Lazarus. (i.e. There's a good chance the error is my own.) Working with 0.9.29 with FPC 2.4.0... (All the code runs stably on Delphi...)
First problem, a SIGSEGV when resizing a TSTRINGGRID. The problem is initiated by my code which states: "With StringGrid1 do RowCount := NRows+1;" (NRows is an integer set to 64). This line then raises an error within DynamicArray.pas Line 134: (TArray.SetLength). I'm leaning towards reporting this problem in Bugtracker as I can't see what I could have done wrong by just resizing the grid. However, is there any protocol I should know about other than just searching to see if the "bug" has already been reported?
Second problem, SIGSEGV after reading from a TSTREAM object. This software can read model parameters from a text file or a binary filestream. After reading from the text file there is no problem. After seemingly successfully reading the exact same data from the filestream and displaying the form, a SIGSEGV is thrown on SendPaintMessage (win32callback.inc, line 386). So this is a mystery to me... I watched the data load from the Filestream and it is not corrupted. Have I corrupted the memory somehow with my object handling? (I do "free" the TFileStream after use.) The error occurs after the button press procedure has completed and the form is being displayed again. It's a mystery to me that reading data in one way causes this crash but the other way is always stable. Is there any way that I can track down the cause of this error further before submitting it to Bugtracker? (I can't imagine how anyone could track this down without my full source which isn't a problem but would be time consuming to distribute and get running on someone else's computer.)
I guess the second question is, therefore, any advice on tracking down a seemingly "random" though reproducible SIGSEGV?
Thanks so much and sorry about the long post. JonC