Recent

Author Topic: ...raised exception class external SIGSEGV ??  (Read 5966 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
...raised exception class external SIGSEGV ??
« on: June 29, 2012, 03:36:38 am »
SQLite3, one table, Grid application.

On a  self-learning application, I get to load the grid, edit, and add records.

I can change the editable "select" clause to change the target table fine, but only if I have not inserted records on the first table opened.

When I insert a record, I commit and refresh. Then after two records or so inserted as said, I edit the query so it calls for another table in the database, and then get the error:
...raised exception class external SIGSEGV

Any suggestions on why this would be happening?

Thanks for any help afforded.

PS. The above is when running in the Lazarus environment.
When running the compiled .exe, the result is a Windows7 message: Form1 is not responding.

« Last Edit: June 29, 2012, 03:41:58 am by Elmug »

paweld

  • Full Member
  • ***
  • Posts: 211
Re: ...raised exception class external SIGSEGV ??
« Reply #1 on: June 29, 2012, 11:53:00 am »
some source code?
Best regards
paweld

Kazmirus

  • New member
  • *
  • Posts: 8
Re: ...raised exception class external SIGSEGV ??
« Reply #2 on: November 26, 2012, 10:34:00 pm »
I have the same problem but the exception came when I try to create the form. First time I create the form Listatowarow is OK, secand time is also OK but every next call to create cause the exception External SIGSEGV at address 4101E6 and popup assembler debug window. I do not know the assembler and cant catch the error by GDB.

...
    if JDBGridControl1.SelectedColumn.Index=0 then
     begin
         {Kartoteka}
          Listatowarow:=TListatowarow.create(Nil);   <-- External SIGSEGV
          Listatowarow.showmodal;
          if Listatowarow.modalresult>0 then
             begin
...

This is source of the form Listatowarow

procedure TListatowarow.FormCreate(Sender: TObject);
var i:integer=0;
begin
  {********************************************}
  {****************** CREATE ******************}
  {********************************************}

  Dm.Magazyny.Open;
  Dm.Magazyny.First;
  DBLookupComboBox1.KeyValue:=Dm.MagazynyUID_MAGAZYNU.asinteger;

  Dm.Wykazkartotek.close;
  Dm.Wykazkartotek.SQL.Clear;
  Dm.Wykazkartotek.Sql.Add('select A.*, P.*, V.*, ');
  Dm.Wykazkartotek.Sql.Add('SUBSTRING(A.RODZAJ_CENY FROM 1 FOR 1) NETTO, ');
  Dm.Wykazkartotek.Sql.Add('SUBSTRING(A.RODZAJ_CENY FROM 2 FOR 1) VAT, ');
  Dm.Wykazkartotek.Sql.Add('SUBSTRING(A.RODZAJ_CENY FROM 3 FOR 1) BRUTTO  ');
  Dm.Wykazkartotek.Sql.Add(' from ');
  Dm.Wykazkartotek.Sql.Add(' KARTA_MAG A ');
  Dm.Wykazkartotek.Sql.Add(' LEFT OUTER JOIN PKWIU P ON (A.UID_PKWIU=P.UID_PKWIU) ');
  Dm.Wykazkartotek.Sql.Add(' LEFT OUTER JOIN STAWKI_VAT V ON (V.UID_STAWKIVAT=A.UID_STAWKIVAT) ');
  Dm.Wykazkartotek.Sql.Add('WHERE ');
  Dm.Wykazkartotek.Sql.Add('A.NAZWA_TOWARU LIKE ''%%''  ');
  Dm.Wykazkartotek.Sql.Add('AND UID_MAGAZYNU='+vartostr(Dm.MagazynyUID_MAGAZYNU.asinteger));
  Dm.Wykazkartotek.Sql.Add('ORDER BY A.NAZWA_TOWARU ');
  Dm.Wykazkartotek.open;


  while i<3 do
  begin
    ComboBox1.Items.Add(Dbgrid1.Columns.Items.Title.Caption);
    inc(i);
  end;
  Combobox1.ItemIndex:=0;
end;
The Informatics is the study of computers as astronomy is about telescopes.

Kazmirus

  • New member
  • *
  • Posts: 8
Re: ...raised exception class external SIGSEGV ??
« Reply #3 on: November 26, 2012, 10:56:52 pm »
I have the same problem but the exception came when I try to create the form. First time I create the form Listatowarow is OK, secand time is also OK but every next call to create cause the exception External SIGSEGV at address 4101E6 and popup assembler debug window. I do not know the assembler and cant catch the error by GDB.

...
    if JDBGridControl1.SelectedColumn.Index=0 then
     begin
         {Kartoteka}
          Listatowarow:=TListatowarow.create(Nil);   <-- External SIGSEGV
          Listatowarow.showmodal;
          if Listatowarow.modalresult>0 then
             begin
...

This is source of the form Listatowarow

procedure TListatowarow.FormCreate(Sender: TObject);
var i:integer=0;
begin
  {********************************************}
  {****************** CREATE ******************}
  {********************************************}

  Dm.Magazyny.Open;
  Dm.Magazyny.First;
  DBLookupComboBox1.KeyValue:=Dm.MagazynyUID_MAGAZYNU.asinteger;

  Dm.Wykazkartotek.close;
  Dm.Wykazkartotek.SQL.Clear;
  Dm.Wykazkartotek.Sql.Add('select A.*, P.*, V.*, ');
  Dm.Wykazkartotek.Sql.Add('SUBSTRING(A.RODZAJ_CENY FROM 1 FOR 1) NETTO, ');
  Dm.Wykazkartotek.Sql.Add('SUBSTRING(A.RODZAJ_CENY FROM 2 FOR 1) VAT, ');
  Dm.Wykazkartotek.Sql.Add('SUBSTRING(A.RODZAJ_CENY FROM 3 FOR 1) BRUTTO  ');
  Dm.Wykazkartotek.Sql.Add(' from ');
  Dm.Wykazkartotek.Sql.Add(' KARTA_MAG A ');
  Dm.Wykazkartotek.Sql.Add(' LEFT OUTER JOIN PKWIU P ON (A.UID_PKWIU=P.UID_PKWIU) ');
  Dm.Wykazkartotek.Sql.Add(' LEFT OUTER JOIN STAWKI_VAT V ON (V.UID_STAWKIVAT=A.UID_STAWKIVAT) ');
  Dm.Wykazkartotek.Sql.Add('WHERE ');
  Dm.Wykazkartotek.Sql.Add('A.NAZWA_TOWARU LIKE ''%%''  ');
  Dm.Wykazkartotek.Sql.Add('AND UID_MAGAZYNU='+vartostr(Dm.MagazynyUID_MAGAZYNU.asinteger));
  Dm.Wykazkartotek.Sql.Add('ORDER BY A.NAZWA_TOWARU ');
  Dm.Wykazkartotek.open;


  while i<3 do
  begin
    ComboBox1.Items.Add(Dbgrid1.Columns.Items.Title.Caption);
    inc(i);
  end;
  Combobox1.ItemIndex:=0;
end;

The error I find in module LCL.

class function TLCLComponent.NewInstance: TObject;
begin
  Result := inherited NewInstance;   <--- Right here External SIGSEGV
  WSRegisterClass;

  TLCLComponent(Result).FWidgetSetClass := GetWSComponentClass(TLCLComponent(Result));
end; 
« Last Edit: November 27, 2012, 12:06:47 am by Kazmirus »
The Informatics is the study of computers as astronomy is about telescopes.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: ...raised exception class external SIGSEGV ??
« Reply #4 on: November 26, 2012, 11:02:50 pm »
Is Listatowarow ever freed?

Also can you debug TListatowarow.FormCreate() line by line to see where it stops? Could be some property from some visual component that can't be accessed in formCreate (because they aren't showing yet).

edit: Use CODE tags. You can also edit your post, don't need to quote it again.
« Last Edit: November 26, 2012, 11:04:28 pm by User137 »

BlueIcaro

  • Hero Member
  • *****
  • Posts: 592
Re: ...raised exception class external SIGSEGV ??
« Reply #5 on: November 26, 2012, 11:02:59 pm »
Try to change this line:
Code: Pascal  [Select][+][-]
  1.     Listatowarow:=TListatowarow.create(Nil);
  2.  

for this one:
Code: Pascal  [Select][+][-]
  1.     Listatowarow:=TListatowarow.create(Self);
  2.  

or this one:
Code: Pascal  [Select][+][-]
  1.     Listatowarow:=TListatowarow.create(Application);
  2.  
/BlueIcaro
Remenber, the lazarus wiki is your friend: http://wiki.lazarus.freepascal.org/Main_Page
General questions (several lenguages) http://wiki.lazarus.freepascal.org/

Kazmirus

  • New member
  • *
  • Posts: 8
Re: ...raised exception class external SIGSEGV ??
« Reply #6 on: November 26, 2012, 11:30:40 pm »
After debug it line by line..
The error I find in module LCL.

class function TLCLComponent.NewInstance: TObject;
begin
  Result := inherited NewInstance;   <--- Right here External SIGSEGV
  WSRegisterClass;

  TLCLComponent(Result).FWidgetSetClass := GetWSComponentClass(TLCLComponent(Result));
end; 

I tryed to use create(self), create(application) - the same error.
« Last Edit: November 27, 2012, 12:07:21 am by Kazmirus »
The Informatics is the study of computers as astronomy is about telescopes.

Kazmirus

  • New member
  • *
  • Posts: 8
Re: ...raised exception class external SIGSEGV ??
« Reply #7 on: November 26, 2012, 11:40:49 pm »
Yes the form Listatowarow is freed.
Sorry that you have to wait for my answer but the forum database is so slow and additional I'm new here and I do not know all options how to replay.  :)
« Last Edit: November 26, 2012, 11:46:19 pm by Kazmirus »
The Informatics is the study of computers as astronomy is about telescopes.

paweld

  • Full Member
  • ***
  • Posts: 211
Re: ...raised exception class external SIGSEGV ??
« Reply #8 on: November 27, 2012, 01:14:14 pm »
On form ListaTowarow move code from event FormCreate to FormShow.

Pozdrawiam
Best regards
paweld

 

TinyPortal © 2005-2018