Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-04

about raised exception class 'External: SIGSEGV'

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

FreeMan

Hello,
I get this errors some time, I can not handle this error so I don't know why raised.

Project myproject raised exception class 'External: SIGSEGV'. -> Ok and continue to run application

Project myproject raised exception class 'RunError(216)'. -> Ok and continue to run application

Project myproject raised exception class 'EAccessViolation'. with message: Access violation -> Ok and continue to run application

Project myproject raised exception class 'External: SIGABRT'. -> Ok and continue to run application

Application freezing. When click to "Reset debugger" button then Application terminate.

My system is Kubuntu 13.10 x64 last svn fpc & lazarus.

looked in google, "External: SIGSEGV" error about not enough info for me.

procedure TFRM_.QUE_Upd(QUE_s: Boolean);
var Unq_id : IntPtr;
begin
if not QUE_s then exit;
try
if not QUE_1.FieldByName('UNQ_ID').IsNull and
(QUE_1.FieldByName('UNQ_ID').AsInteger>=0)then
Unq_id := QUE_1.FieldByName('UNQ_ID').AsInteger
else Unq_id := -1;
QUE_1.Close;
QUE_1.Open;
if Unq_id-1then QUE_1.Locate('UNQ_ID', Unq_id, []);
if not QUE_2.FieldByName('UNQ_ID').IsNull and
(QUE_2.FieldByName('UNQ_ID').AsInteger>=0)then
Unq_id := QUE_2.FieldByName('UNQ_ID').AsInteger
else Unq_id := -1;
QUE_2.Close;
QUE_2.Open;
if Unq_id-1then QUE_2.Locate('UNQ_ID', Unq_id, []);
except
on E: Exception do begin
Application.MessageBox(PChar('Error raised...' + LineEnding + E.Message),
PChar(Application.Title), MB_OK + MB_ICONERROR);
end;
end;
end;

I have QUE_3 too. Its master detail with QUE_2.
try-except not handle this error. I tried many different code way, always and uncertain time error raised exception
All 3 queries has a rxgrid. TFRM_.QUE_Upd procedure for, update datas on form if other forms or applications changed data.
For testing I remove debug info, and run with out IDE, I can't see error but Application freezing and terminate it.

Has any one idea about this ?
Regards.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140414/d99d0d22/attachment.html>

Reply by email

Luca Olivetti
to FreeMan

El 14/04/14 12:49, FreeMan ha escrit:

Show quoted text 7 lines
Hello, I get this errors some time, I can not handle this error so I don't know why raised. Project myproject raised exception class 'External: SIGSEGV'. -> Ok and continue to run application

It's an access to unallocated memory or trying to use a class instance that doesn't exist (i.e. it is nil).
Since I don't know your program, maybe one of the FieldByName call is returning nil (i.e., a field with that name doesn't exist, so either the IsNull or the AsInteger would generate a SIGSEV:

Show quoted text 14 lines
if not QUE_1.FieldByName('UNQ_ID').IsNull and (QUE_1.FieldByName('UNQ_ID').AsInteger>=0)then Unq_id := QUE_1.FieldByName('UNQ_ID').AsInteger else Unq_id := -1; QUE_1.Close; QUE_1.Open; if Unq_id-1then QUE_1.Locate('UNQ_ID', Unq_id, []); if not QUE_2.FieldByName('UNQ_ID').IsNull and (QUE_2.FieldByName('UNQ_ID').AsInteger>=0)then Unq_id := QUE_2.FieldByName('UNQ_ID').AsInteger else Unq_id := -1; try-except not handle this error.

No currently it doesn't :-(
Note that in most cases when hitting such an error the only sensible option would be to terminate the program, but I'd like to intercept the exception and log it to a file before terminating the program, so I can do a post-mortem and see where the SIGSEV occurred.

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007

Reply by email

FreeMan
to Luca Olivetti

Thank you for answer Luca,

14-04-2014 16:58 tarihinde, Luca Olivetti yazd?:

Show quoted text 5 lines
It's an access to unallocated memory or trying to use a class instance that doesn't exist (i.e. it is nil). Since I don't know your program, maybe one of the FieldByName call is returning nil (i.e., a field with that name doesn't exist, so either the IsNull or the AsInteger would generate a SIGSEV:

I understood you, I was sent my code, its out off my code, Maybe Grid has a problem,
Q.Close;
Q.Open; and query so fast close & open, can not grid be fast like that ? when I try some different codes, sumo time I get list index outoff bound(x) error in
/opt/lazarus/lcl/grids.pas TCustomGrid.ColRowToOffset(.... line 5562 AccumHeight[index]this cache class maybe not be fast, just my idea

I changed to code to this.This is not good for me, because user has to select row always, check before everything because background refresh move selected row to first row.

  if not QUE_s then exit;
     try
      QUE_1.Refresh;
      QUE_2.DisableControls;
      QUE_2.Refresh;
      QUE_2.EnableControls;
     except....
Show quoted text 5 lines
No currently it doesn't Note that in most cases when hitting such an error the only sensible option would be to terminate the program, but I'd like to intercept the exception and log it to a file before terminating the program, so I can do a post-mortem and see where the SIGSEV occurred.

Can you explain little bir more please? sorry for my poor english

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140414/c4f1a062/attachment.html>

Reply by email

Luca Olivetti
to FreeMan

El 14/04/14 16:26, FreeMan ha escrit:

I understood you, I was sent my code, its out off my code, Maybe Grid has a problem, Q.Close; Q.Open; and query so fast close & open, can not grid be fast like that ?

I don't think the problem is the grid, but I could be wrong. Note that, while fpc doesn't see this exception, gdb does, so you can try to run your code from lazarus (with gdb) and see where the SIGSEV is generated.

Show quoted text 7 lines
> No currently it doesn't > Note that in most cases when hitting such an error the only sensible > option would be to terminate the program, but I'd like to intercept the > exception and log it to a file before terminating the program, so I can > do a post-mortem and see where the SIGSEV occurred. Can you explain little bir more please? sorry for my poor english

Well, a SIGSEV usually means that you cannot rely on the contents of memory, so recovery is probably impossible.

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007

Reply by email

Martin Frb
to FreeMan: I get this errors some time, I can not handle this error so I don't know why raised.…
FreeMan wrote 11 lines
Hello, I get this errors some time, I can not handle this error so I don't know why raised. Project myproject raised exception class 'External: SIGSEGV'. -> Ok and continue to run application Project myproject raised exception class 'RunError(216)'. -> Ok and continue to run application

run errors are translated here:
http://www.freepascal.org/docs-html/user/userap4.html#x188-195000D

As already explained you are accessing memory that is not part of your app.

If you run in the debugger, then when the debugger reports the error choose "break", and open the stack window., and search the top line that is in your app.
Sometimes the debugger does not get the stack, you can try to run again. The debugger may report an error again, and there is a chance the stack is available then.
If not, then it will be hard to find. (You need to step, until you find the line, then stop, start over step again, step into the line , start over ....)

If you find the line, inspect all variables.

---------------
You should compile with options such as
- Range check and similar -Criot
- uninitialzied vars -gt (also try -gtt and -gttt / but only one at a time)
- heaptrc -gh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140414/8aae76f2/attachment-0001.html>

Reply by email

FreeMan
to Martin Frb

14-04-2014 17:39 tarihinde, Martin Frb yazd?:

Show quoted text 9 lines
If you run in the debugger, then when the debugger reports the error choose "break", and open the stack window., and search the top line that is in your app. Sometimes the debugger does not get the stack, you can try to run again. The debugger may report an error again, and there is a chance the stack is available then. If not, then it will be hard to find. (You need to step, until you find the line, then stop, start over step again, step into the line , start over ....)
QUE_1Delete;
   if QUE_1.Transaction.Active then
        QUE_1.Transaction.CommitRetaining;

breakpoint on this line:
QUE_1Delete; stop here, Press F8, jump to
/opt/freepascal/2.7.1/packages/fcl-db/src/base/dataset.inc line: 1553 everything is okay, after this been crazy :)
if continue F8 step by step and finish "procedure TDataSet.Delete;" but when jump in "procedure TDataSet.Delete;" press F9 SIGSEGV error popup.

Martin, thanks for answer, tomorrow I'll try your parameter and other suggestions, if still goes on I delete all fpc & lazarus all libs. I'm work on this erorr as long as 2 days, I couldn't find anything :( thank you

Reply by email

Martin Frb
to FreeMan
FreeMan wrote 12 lines
QUE_1Delete; if QUE_1.Transaction.Active then QUE_1.Transaction.CommitRetaining; breakpoint on this line: QUE_1Delete; stop here, Press F8, jump to /opt/freepascal/2.7.1/packages/fcl-db/src/base/dataset.inc line: 1553 everything is okay, after this been crazy :) if continue F8 step by step and finish "procedure TDataSet.Delete;" but when jump in "procedure TDataSet.Delete;" press F9 SIGSEGV error popup.

Make sure you turn off optimization and smart linking, for the debugger to run ok
http://wiki.lazarus.freepascal.org/Debugger_Setup

Reply by email

FreeMan
to Martin Frb

14-04-2014 18:14 tarihinde, Martin Frb yazd?:

Make sure you turn off optimization and smart linking, for the debugger to run ok http://wiki.lazarus.freepascal.org/Debugger_Setup

Check your link and mine settings. thats same. one more try and I get error. (pictures on your link need update some properties not on there) I'm not sure, but I'm using rxgrid and Footeroptions.Active := True; one field has get sum. other grid has same and two field has sum. When Active false this, Its work without error, I need more test, then can be sure.
for example procedure TRxDBGrid.CalcStatTotals; has ...

   DHS.First;
   while not DHS.EOF do

I'll add TNotifyEvent one more, Programmer write sql code so faster then this loop. I wish ondrawfooterevent too, If I can write this codes I'll sent to bugtracker (suggestion) too

witch parameter have add for debuging 3rth party components ? Regards.

Reply by email