[Lazarus] OpenBSD 5.8 64bit - lazarus - exception

Tomaž Žveglič tomaz.zveglic at gmail.com
Tue Oct 27 22:19:01 CET 2015



On 10/27/15 09:46, Zeljko wrote:
>
>
>
>> gdb ./lazarus
>> GNU gdb 6.3 ...
>> (gdb) run
>> Starting program: /root/lazarus/lazarus
>>
>> Program received signal SIGBUS, Bus error.
>> 0x00000002954fe2fa in g_object_new ()
>>     from /usr/local/lib/libgobject-2.0.so.4200.1
>> Current language:  auto; currently c
>> (gdb) bt
>> #0  0x00000002954fe2fa in g_object_new ()
>>     from /usr/local/lib/libgobject-2.0.so.4200.1
>> #1  0x00000002f2a1a195 in gtk_adjustment_new ()
>>     from /usr/local/lib/libgtk-x11-2.0.so.2400.0
>> #2  0x00000002f2b2071f in gtk_range_set_adjustment ()
>>     from /usr/local/lib/libgtk-x11-2.0.so.2400.0
>> #3  0x00000002954fd46d in g_object_new_internal ()
>>     from /usr/local/lib/libgobject-2.0.so.4200.1
>> #4  0x00000002954fdd45 in g_object_new_valist ()
>>     from /usr/local/lib/libgobject-2.0.so.4200.1
>> #5  0x00000002954fe364 in g_object_new ()
>>     from /usr/local/lib/libgobject-2.0.so.4200.1
>> #6  0x0000000000a1ca0e in GETSTYLEWITHNAME (
>>      WNAME=0x19b6d08 "vertical scrollbar") at gtk2proc.inc:7860
>> #7  0x0000000000a1c3d7 in GETSTYLE (ASTYLE=LGSVERTICALSCROLLBAR)
>>      at gtk2proc.inc:7665
>
> This is not trunk lazaruz according to line info .... so try next and 
> give feedback (I'll try to install OpenBSD 5.8 64bit in vmware next 
> days and see what happens)....
> in lcl/widgetset/gtk2/gtk2proc.inc
> find lines (around line 7665) and add gtkadjustment:
>
>       If CompareText(WName,LazGtkStyleNames[lgsVerticalScrollbar])=0 
> then begin
>         lgs:=lgsVerticalScrollbar;
>         StyleObject^.Widget := gtk_vscrollbar_new( 
> gtk_adjustment_new(0, 0, 100, 1, 1, 100)); // add gtkAdjustment 
> instead of nil
>       end
>     else
>       If CompareText(WName,LazGtkStyleNames[lgsHorizontalScrollbar])=0 
> then begin
>         lgs:=lgsHorizontalScrollbar;
>         StyleObject^.Widget := gtk_hscrollbar_new( 
> gtk_adjustment_new(0, 0, 100, 1, 1, 100)); // add gtkAdjustment 
> instead of nil
>       end
>
>
> I know that this will create memleak, but just want to know if it will 
> crash when gtkAdjustment is added as param to gtk_vscrollbar_new()
>
> Thanks
>
> zeljko
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Hi Željko,

thanks for hints :)


I changed file "lazarus/lcl/interfaces/gtk2/gtk2proc.inc" like this:
-------------------------
var
Adjustment: PGtkAdjustment;
-------------------------
       If CompareText(WName,LazGtkStyleNames[lgsVerticalScrollbar])=0 
then begin
         lgs:=lgsVerticalScrollbar;
         Adjustment := PgtkAdjustment( gtk_adjustment_new(0, 0, 100, 1, 
1, 100));
         StyleObject^.Widget := gtk_vscrollbar_new(Adjustment); // add 
gtkAdjustment instead of nil
       end
     else
       If CompareText(WName,LazGtkStyleNames[lgsHorizontalScrollbar])=0 
then begin
         lgs:=lgsHorizontalScrollbar;
         Adjustment := PgtkAdjustment( gtk_adjustment_new(0, 0, 100, 1, 
1, 100));
         StyleObject^.Widget := gtk_hscrollbar_new(Adjustment); // add 
gtkAdjustment instead of nil
       end
-------------------------

Now some new error occured:
-------------------------
$ ./lazarus
TMainIDE.ParseCmdLineOptions:
   PrimaryConfigPath="/home/tomaz/.lazarus"
   SecondaryConfigPath="/etc/lazarus"
[FORMS.PP] ExceptionOccurred
   Sender=EAccessViolation
   Exception=Access violation
   Stack trace:
   $00000002B60EB2FA
TApplication.HandleException Access violation
   Stack trace:
   $00000002B60EB2FA
-------------------------

-------------------------
$ gdb ./lazarus
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd5.8"...
(gdb) run
Starting program: /home/tomaz/prg/lazarus/lazarus
TMainIDE.ParseCmdLineOptions:
   PrimaryConfigPath="/home/tomaz/.lazarus"
   SecondaryConfigPath="/etc/lazarus"

Program received signal SIGBUS, Bus error.
0x00000002b51792fa in g_object_new () from 
/usr/local/lib/libgobject-2.0.so.4200.1
Current language:  auto; currently c
(gdb) bt
#0  0x00000002b51792fa in g_object_new () from 
/usr/local/lib/libgobject-2.0.so.4200.1
#1  0x00000002e19b1195 in gtk_adjustment_new () from 
/usr/local/lib/libgtk-x11-2.0.so.2400.0
#2  0x00000002e1a6b195 in gtk_layout_constructor () from 
/usr/local/lib/libgtk-x11-2.0.so.2400.0
#3  0x00000002b5178a92 in g_object_new_internal () from 
/usr/local/lib/libgobject-2.0.so.4200.1
#4  0x00000002b5178d45 in g_object_new_valist () from 
/usr/local/lib/libgobject-2.0.so.4200.1
#5  0x00000002b5179364 in g_object_new () from 
/usr/local/lib/libgobject-2.0.so.4200.1
#6  0x0000000000a1bae4 in CREATEFORMCONTENTS (AFORM=0x2c31ef530, 
FORMWIDGET=0x2887b8500,
     AWIDGETINFO=0x282a0bb20) at gtk2proc.inc:7485
#7  0x0000000000ad6252 in CREATEHANDLE (self=0x2c31f0a30, 
AWINCONTROL=0x2c31ef530, APARAMS=
       {CAPTION = 0x2174d4fb0 "Lazarus", STYLE = 100663296, EXSTYLE = 
65536, X = 561, Y = 370, WIDTH = 429, HEIGHT = 341, WNDPARENT = 0, PARAM 
= 0x0, WINDOWCLASS = {STYLE = 0, LPFNWNDPROC = 0x0, CBCLSEXTRA = 0, 
CBWNDEXTRA = 0, HINSTANCE = 0, HICON = 0, HCURSOR = 0, HBRBACKGROUND = 
0, LPSZMENUNAME = 0x0, LPSZCLASSNAME = 0x0}, WINCLASSNAME = '\0' 
<repeats 63 times>})
     at gtk2wsforms.pp:424
#8  0x000000000097f88d in CREATEWND (this=0x2c31ef530) at 
wincontrol.inc:7399
#9  0x000000000077100d in CREATEWND (this=0x2c31ef530) at 
scrollingwincontrol.inc:23
#10 0x000000000077a302 in CREATEWND (this=0x2c31ef530) at 
customform.inc:2584
#11 0x000000000077be31 in CREATEWND (this=0x2c31ef530) at 
customform.inc:3050
#12 0x000000000097dddc in CREATEHANDLE (this=0x2c31ef530) at 
wincontrol.inc:7309
#13 0x0000000000980ade in HANDLENEEDED (this=0x2c31ef530) at 
wincontrol.inc:7755
#14 0x000000000097564b in CHECKHANDLEALLOCATED (parentfp=0x7f7ffffdfa40,
     AWINCONTROL=0x2c31ef530) at wincontrol.inc:3445
#15 0x000000000097523b in DOALLAUTOSIZE (this=0x2c31ef530) at 
wincontrol.inc:3496
#16 0x00000000009941d2 in ENABLEAUTOSIZING (this=0x2c31ef530) at 
control.inc:5460
#17 0x0000000000990528 in SETVISIBLE (this=0x2c31ef530, VALUE=true) at 
control.inc:4300
#18 0x0000000000773e4a in SETVISIBLE (this=0x2c31ef530, VALUE=true) at 
customform.inc:486
#19 0x0000000000778eaa in SHOW (this=0x2c31ef530) at customform.inc:2196
#20 0x000000000072a8f2 in main () at lazarus.pp:112
(gdb)
-------------------------



Regards,
TomazZ




More information about the Lazarus mailing list