Hello everyone,
First of all I want to apologize for my poor skills in database handling, many years ago I had a basic formation on Lazarus and free pascal and recently I wanted to make a program for the ice cream company of my dad to make his life easier, all was going quite well until I started getting SIGSEGV errors linked apparently to the CSVDocument unit that I have imported from this link:
http://wiki.freepascal.org/CsvDocumentI also used this the mainfrm.pas as model to create my program
http://sourceforge.net/p/lazarus-ccr/svn/3062/tree/components/csvdocument/demo/mainfrm.pasIn the beginning my program was working fine (main menu window was working, I could open a second form on which I was able to select the database with a TOpenDialog, the database path was already stored in a registery so the user could just press continue or load a specific file, then when continue was pressed the inventory window was showing up in which I already had configured a barcode scanner reading procedure (but this part is not responsible of the bug as it only consist of a setfocus code and some visible:=true/false on label elements, no interaction with the database yet)
Then the problem appeared when the CSVDocument started being used, the strange thing is that it appeared the first time when in the third form I clicked on a button that was programmed as follows:
procedure TForm2.Button3Click(Sender: TObject);
begin
UpdateView;
end;
I had a SIGSEGV error, then when pressed ok, the CSVDocument page popped up in the source editor and the line "the Result := FRows.Count;" was evidenced in grey, this line comes from the function below:
function TCSVDocument.GetRowCount: Integer;
begin
Result := FRows.Count;
end;
I had multiple times this SIGSEGV error showing up and each time linked apparently to the CSVDocument while using the Form, and while I was trying to fix the problem it started crashing right after the launch of UNIT1 with the same error, since then I can't get the unit to show up in a stable way. When pressing the execute button (green triangle in lazarus) It starts compiling everything, then the main menu of my program pops up and instantly the application crashes showing me that nice error message you can see in attachment.
Of course I've been looking for an answer over the internet but never found a topic that concerned specifically the CSVDocument and a related SIGSEGV error.
The strange thing is that the error now shows up as soon as I start the program and this is very odd as the program is supposed to load Unit1 first that is a very simple unit that only have the function to execute showmodal codes for other forms when clicking on buttons.
So please If anyone would be kind enough to help me here I would be thankful
You will find two pictures of the program at the moment when the error shows up and the CSVdocument shows the faulty line, and I also attached the debug log that will be, I hope, more useful.
Sincerely, thanks for your help
Thierry