Recent

Author Topic: [Solved] Error 'External: SIGSEGV'  (Read 20451 times)

sanor

  • New member
  • *
  • Posts: 7
[Solved] Error 'External: SIGSEGV'
« on: January 12, 2010, 05:14:18 pm »
Is a simple program with a connection to a database in firebird, but
when I click a button with the code:

frmAreas.showmodal;

the form frmAreas does not appear and the program stops, and I get the error:

Project maladir raised exception class 'External: SIGSEGV'.

Anyone know why this error appears? and its resolution?
« Last Edit: January 20, 2010, 11:02:23 pm by sanor »

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: Error 'External: SIGSEGV'
« Reply #1 on: January 12, 2010, 08:04:59 pm »
Did you create the form somewhere?

SigSegv is a general message like "acces violation"
http://en.wikipedia.org/wiki/SIGSEGV

sanor

  • New member
  • *
  • Posts: 7
Re: Error 'External: SIGSEGV'
« Reply #2 on: January 12, 2010, 10:27:38 pm »
resolved

I forgot to put: Application.CreateForm (TfrmAreas, frmAreas); in Unit.  :)

The delphi add this line of code automatically, and Lazarus not, so I forgot.

Thanks

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: Error 'External: SIGSEGV'
« Reply #3 on: January 12, 2010, 10:32:04 pm »
The delphi add this line of code automatically, and Lazarus not, so I forgot.

No, if you add a form with "File -> New Form", lazarus adds "CreateForm" to the *.lpr too.

sanor

  • New member
  • *
  • Posts: 7
Re: [Resolved] Error 'External: SIGSEGV'
« Reply #4 on: January 12, 2010, 11:56:24 pm »
My lazarus is not doing that. I have to put the "CreateForm" manually for each form.

__________________
program Project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, UPrincipal, UAreas, LResources
  { you can add units after this };

{$IFDEF WINDOWS}{$R maladir.rc}{$ENDIF}

begin
  Application.Initialize;
  Application.CreateForm(TfrmPrincipal, frmPrincipal);
  Application.CreateForm(TfrmAreas, frmAreas);
  Application.Run;
end.   

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [Resolved] Error 'External: SIGSEGV'
« Reply #5 on: January 13, 2010, 09:59:28 am »
Quote
My lazarus is not doing that. I have to put the "CreateForm" manually for each form.
Bug? What's your version?

sanor

  • New member
  • *
  • Posts: 7
Re: [Resolved] Error 'External: SIGSEGV'
« Reply #6 on: January 13, 2010, 10:20:19 am »
Lazarus 0.9.28.2 beta
FPC 2.2.4

dmdmaasz6

  • New Member
  • *
  • Posts: 11
Re: [Solved] Error 'External: SIGSEGV'
« Reply #7 on: June 18, 2011, 04:35:01 pm »
Hello Guys im a student from namibia and im doging my end year  grade 12 project in lazarus 0.9.28.2 and I created a mySQLdatabase program but every time I use my save button wwith the following code :
procedure TForm2.Button1Click(Sender: TObject);
begin
  Form2 := TForm2.Create(nil);
  try
    Form2.DataSource1.DataSet := CatQuery1;
    CatQuery1.ParseSQL:=true;
    CatQuery1.ReadOnly:=false;
    CatQuery1.Open;
  finally
    CatQuery1.UpdateMode:=upWhereChanged;
    CatQuery1.ApplyUpdates;
    IMTransaction1.Commit;
    Form2.Free;
    CatQuery1.Close;
    CatQuery1.ParseSQL:=false;
    CatQuery1.ReadOnly:=true;
    Form2.ShowModal;
  end;
end;                     


It gives the error 'External: SIGSEGV' can you guys plz assist me in my problem cause ive tried and tried but the lack of entire knowledge concerning this error has left me desperate for help.
Any input will be much appreciated.

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: [Solved] Error 'External: SIGSEGV'
« Reply #8 on: June 18, 2011, 04:48:08 pm »
 :o
Code: [Select]
procedure TForm2.Button1Click(Sender: TObject);
begin
  Form2 := TForm2.Create(nil);
  try
    Form2.DataSource1.DataSet := CatQuery1;
    CatQuery1.ParseSQL:=true;
    CatQuery1.ReadOnly:=false;
    CatQuery1.Open;
  finally
    CatQuery1.UpdateMode:=upWhereChanged;
    CatQuery1.ApplyUpdates;
    IMTransaction1.Commit;
    Form2.Free;
    CatQuery1.Close;
    CatQuery1.ParseSQL:=false;
    CatQuery1.ReadOnly:=true;
    Form2.ShowModal;
  end;
end;       
this is very, very bad.

You cannot create Form2 by click on Button which is placed on the Form2 !

You cannot do Form2.Free and few lines later do Form2.ShowModal because Form2 does not exists at that moment!

I guess that all Forms in your project are autocreated. Try:

Code: [Select]
procedure TForm2.Button1Click(Sender: TObject);
begin
  //Form2 := TForm2.Create(nil);
  try
    Form2.DataSource1.DataSet := CatQuery1;
    CatQuery1.ParseSQL:=true;
    CatQuery1.ReadOnly:=false;
    CatQuery1.Open;
  finally
    CatQuery1.UpdateMode:=upWhereChanged;
    CatQuery1.ApplyUpdates;
    IMTransaction1.Commit;
    //Form2.Free;
    CatQuery1.Close;
    CatQuery1.ParseSQL:=false;
    CatQuery1.ReadOnly:=true;
    //Form2.ShowModal;
  end;
end;       

and Form2.ShowModal must be done elsewhere - in Form1.ButtonXY click?
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

talitaedwiges

  • Newbie
  • Posts: 5
Error 'External: SIGSEGV'
« Reply #9 on: January 21, 2023, 03:02:27 pm »
SORRY BUT I DON'T KNOW HOW TO CREATE A NEW TOPIC!

Estou criando uma API de raltorios no lazarus + fortes, But when I try to call my Form from the report TReportTeste.Create(nil) the system displays the SIGSEGV error.

This is an API using the strong report.



 

TinyPortal © 2005-2018