Recent

Author Topic: 'External: SIGSEGV'  (Read 15563 times)

dmdmaasz6

  • New Member
  • *
  • Posts: 11
'External: SIGSEGV'
« on: June 19, 2011, 10:12:33 am »
Hello to all reading this post... ;)

I am a student from namibia working on my grade 12 endyear project for computer studies. I have created a Inventory Management program that is working pretty well under the circumstances. I have programmed a save button for each table in my database so that the user can opptionally save his/her data. Now the problem is that on running the program everything is working 100% but as soon as one of the save buttons are pressed I get an error saying Project InventoryManager.exe raised exception class 'External: SIGSEGV'.  :'(

Im using a 32BIT computer with 2.2GHz Intel Core 2 Duo Processor and 4GB DDR2.
In my program I used a MySQL50Connection1 to connet to the database I creted in MySQL. Can anyone please help me to find the root of my problem and how to slove it, becaus all my tries have failed in missery and left me with nothing else but desspritness... >:(

Thank you to anyone that took the time to read my post...  :D

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: 'External: SIGSEGV'
« Reply #1 on: June 19, 2011, 12:22:48 pm »
Thank you to anyone that took the time to read my post...  :D

You're welcome.
To be able to help you we need more information (like the code that causes the problem, variable type defintions etc.).
If it's related to your other post: do not call Form2.Free and a number of lines below refer to the same variable.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

dmdmaasz6

  • New Member
  • *
  • Posts: 11
Re: 'External: SIGSEGV'
« Reply #2 on: June 19, 2011, 02:42:35 pm »
Ive changed my code to the following:
Procedure TForm2.Button1Click(Sender: TObject);
Begin
   Try
      Form2.Datasource1.Dataset:=CatQuery1;
      CatQuery1.ParseSQL:=true;
      CatQuery1.ReadOnly:=false;   
      CatQuery1.Open;
   Finally
      CatQuery1.UpdateMode:=upWhereChanged;
      CatQuery1.ApplyChanges;
      IMTransaction1.commit;
      CatQuery1.close;
      CatQuery1.ParseSQL:=false;
      CatQuery1.ReadOnly:=true;
   end;
end;


When the error occurs the program opens the control.inc with the following code:
procedure TControl.Click;
Begin
    //DebugLn(['Tcontrol.click ' ,DbgName(Self)]);
    If (not (csdesigning in componentState)) and (ActionLink <> nil) and
       ((Action=nil) or (@Fonclick <> @Action.OnExecute) or Assigned(FOnClick)) then
       ActionLink.Execute(self)
    Else
    If Assigned(FOnClick) then
      FOnClick(self);
End;

The program highlights the bold area in grey with an little green arrow to the side.
When I run the program from the executable it gives an error saying Access violation.
 
Thanks for the time. :)

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: 'External: SIGSEGV'
« Reply #3 on: June 19, 2011, 05:20:53 pm »
Change
Code: Pascal  [Select][+][-]
  1.  Form2.Datasource1.Dataset:=CatQuery1;
to
Code: Pascal  [Select][+][-]
  1.   Datasource1.Dataset:=CatQuery1;
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

dmdmaasz6

  • New Member
  • *
  • Posts: 11
Re: 'External: SIGSEGV'
« Reply #4 on: June 19, 2011, 05:55:33 pm »
I tried but the error stays the same...

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: 'External: SIGSEGV'
« Reply #5 on: June 19, 2011, 05:58:31 pm »
Use the debugger to exactly locate the line that causes the exception.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

dmdmaasz6

  • New Member
  • *
  • Posts: 11
Re: 'External: SIGSEGV'
« Reply #6 on: June 19, 2011, 09:16:25 pm »
Ive tried round about everything and just struck a point where I just dont know anymore. Can you maybe give me your e-mail and ill e-mail you my project and then you can take a look if you have time other wise its fine,I appreciate all your time.

Thanx a million...

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: 'External: SIGSEGV'
« Reply #7 on: June 20, 2011, 11:00:21 pm »
Ive tried round about everything and just struck a point where I just dont know anymore. Can you maybe give me your e-mail and ill e-mail you my project and then you can take a look if you have time other wise its fine,I appreciate all your time.

Thanx a million...
Just upload a minimal version of your program here that shows the error (under Attachments and other options).
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

dmdmaasz6

  • New Member
  • *
  • Posts: 11
Re: 'External: SIGSEGV'
« Reply #8 on: June 28, 2011, 09:14:07 pm »
Oky thanx a lot I really appreciate the help, here is a smaller version of another small program im working on and it generates the same problem around the save/update button.

Enjoy your day.  :)

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: 'External: SIGSEGV'
« Reply #9 on: June 28, 2011, 10:38:12 pm »
All event handlers are empty.
How to reproduce the error with the code you uploaded?
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: 'External: SIGSEGV'
« Reply #10 on: June 28, 2011, 11:12:17 pm »
When the error occurs the program opens the control.inc with the following code:
procedure TControl.Click;
Begin
    //DebugLn(['Tcontrol.click ' ,DbgName(Self)]);
    If (not (csdesigning in componentState)) and (ActionLink <> nil) and
       ((Action=nil) or (@Fonclick <> @Action.OnExecute) or Assigned(FOnClick)) then
       ActionLink.Execute(self)
    Else
    If Assigned(FOnClick) then
      FOnClick(self);
End;

The program highlights the bold area in grey with an little green arrow to the side.
When I run the program from the executable it gives an error saying Access violation.

The grey line with the green arrow, means that you are running in the debugger.

However, the fact that you the debugger shows this location is odd.... Either:
* Your something went wrong with your form1. Inspect (tooltip, or watches Shift-F5) the value of "self" and "FOnClick"
* Your app is not compiled with debug info. Menu "Project" => "Project options" => tab "linking" compile with debug info (either the option with -g, or -gw)


You can use the stacktrace (Menu "View" => "Debug windows" => "callstack" to see more info were you get called.

You could set a breakpoint (red bullet in the gutter, just  mouse click the gutter, or use F5) to stop on the begin of you procedure, and single step it with F8

dmdmaasz6

  • New Member
  • *
  • Posts: 11
Re: 'External: SIGSEGV'
« Reply #11 on: June 29, 2011, 07:04:03 pm »
I changed the debug information as you said and amazingly it worked and the Music library that I created as practise run to check if I do somthing else does the statement "SQLQuery1.ApplyUpdates;" work and now that program runs no problems attached.

But my Real project the Inventory Manager doesnt work and I made the corresponding changes in the properties, Ive attached the Inventory Manager below if that helps...

Thanx for the help... :)

dhyani

  • Newbie
  • Posts: 5
Re: 'External: SIGSEGV'
« Reply #12 on: July 03, 2011, 12:13:28 am »
You have to add "Form1." to the Save buttons onClick events.

procedure TForm2.Button1Click(Sender: TObject);
begin
   Form1. CatQuery1.ApplyUpdates;
end;

By the way... you can drop the .Create method for the forms, they get created on initialization [in the .lpr file]

procedure TForm1.Button2Click(Sender: TObject);
begin
   Form3 := TForm3.Create(nil);
    Form3.ShowModal;
end; 

dmdmaasz6

  • New Member
  • *
  • Posts: 11
Re: 'External: SIGSEGV'
« Reply #13 on: July 08, 2011, 10:08:36 pm »
Thanx for your advice...

My program is running like a dream!!!! :)

 

TinyPortal © 2005-2018