[Lazarus] How to catch an unhandled exception?

Gabor Boros mlnglsts at bgss.hu
Fri Mar 9 10:14:51 CET 2018


Hi All,

The result of the attached example (which use MWA's Firebird Pascal API) 
for me is an exception:


Gstat execution time Fri Mar  9 09:29:18 2018

Database header page information:
         Flags                   0
         Generation              173
         System Change Number    0
         Page size               8192
         ODS version             12.0
         Oldest transaction      161
         Oldest active           162
         Oldest snapshot         162
         Next transaction        164
         Sequence number         0
         Next attachment ID      27
         Implementation          HW=AMD/Intel/x64 little-endian OS=Linux 
CC=gcc
         Shadow count            0
         Page buffers            0
         Next header page        0
         Database dialect        3
         Creation date           Feb 2, 2018 14:07:24
         Attributes              force write

     Variable header data:
         *END*
Gstat completion time Fri Mar  9 09:29:18 2018

Heap dump by heaptrc unit
355 memory blocks allocated : 948252/948432
355 memory blocks freed     : 948252/948432
0 unfreed memory blocks : 0
True heap size : 131072
True free heap : 131072
An unhandled exception occurred at $00007FF97F0A3147:
EAccessViolation:
   $00007FF97F0A3147


If comment out cthreads from the uses the exception is:


An unhandled exception occurred at $00007F21B71F5147:
EAccessViolation:
   $00007F21B71F5147
   $00007F21B71F751B
   $00007F21B71F769C
   $00007F21B746BFFF


If run with gdb (and cthreads):


Heap dump by heaptrc unit
355 memory blocks allocated : 948252/948432
355 memory blocks freed     : 948252/948432
0 unfreed memory blocks : 0
True heap size : 131072
True free heap : 131072
[Thread 0x7ffff5991700 (LWP 2874) exited]
[Thread 0x7ffff6192700 (LWP 2873) exited]
[Thread 0x7ffff7fe3740 (LWP 2869) exited]
Cannot find user-level thread for LWP 2875: generic error


Any idea how to detect what/where is the source of the exception?

I use Linux 64bit, FPC 3.0.4 and Lazarus fixes_1_8.

Gabor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FB3API_IBX.tar.gz
Type: application/x-gzip
Size: 1617 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180309/bac08696/attachment.bin>


More information about the Lazarus mailing list