[fpc-pascal] could not compile lazarus "make[2]: *** [lazarus] Killed"

Vincent Snijders vsnijders at vodafonevast.nl
Fri Apr 17 14:16:36 CEST 2009


Benedikt Schindler schreef:
> i recompiled the hole fpc with the option "-gl" and the patch Paul 
> Ishenin mentioned.
> there is still a problem with programms, that wonna use windows.
> console prorgamms just work fine.
> 
> if i try to run a lazarus programm i get this backtrace.
> 
> 
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x49534e40 in ?? ()
> (gdb) cont
> Continuing.
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x4052d860 in g_object_unref () from /usr/lib/libgobject-2.0.so.0
> (gdb) bt
> #0  0x4052d860 in g_object_unref () from /usr/lib/libgobject-2.0.so.0
> #1  0x0015ada0 in TGTK2WIDGETSET__DESTROY (vmt=0xffffffff, 
> this=0x40b8e020) at 
> /media/mmcblk0p3/lazarus/lcl/interfaces/gtk2/gtk2widgetset.inc:551
> #2  0x0015ad04 in TGTK2WIDGETSET__CREATE (vmt=0x205fc8, this=0x40b8e020) 
> at /media/mmcblk0p3/lazarus/lcl/interfaces/gtk2/gtk2widgetset.inc:547
> #3  0x0003b164 in CREATEWIDGETSET (AWIDGETSETCLASS=<incomplete type>) at 
> /media/mmcblk0p3/lazarus/lcl/forms.pp:1706
> #4  0x0003a8a0 in INTERFACES_init () at 
> /media/mmcblk0p3/lazarus/lcl/interfaces/gtk2/interfaces.pas:39
> #5  0x00031a50 in fpc_initializeunits () at 
> /media/mmcblk0p3/fpc/rtl/inc/system.inc:766
> #6  0x00019a8c in main () at om_test_suite.lpr:13

What I think that happens is:
The constructor TGTK2WIDGETSET.CREATE fails somehow, unclear from this 
back trace, but probably before or in im_context:=gtk_im_multicontext_new;

The destructor is called which tries to cleanup im_context, which fails, 
because im_context has not been intialized correctly.

This particular crash may be prevented by using this destructor:
destructor TGtk2WidgetSet.Destroy;
begin
   if im_context<>nil then
     g_object_unref(im_context);
   im_context:=nil;
   im_context_widget:=nil;
   inherited Destroy;
end;

Nevertheless, it doesn't solve the exception in the constructor on 
TGtk2Widget.

Vincent






More information about the fpc-pascal mailing list