[Lazarus] GUI freeze under GTK2

Cyrax evvke at hotmail.com
Tue Feb 21 15:47:05 CET 2017


On 20.02.2017 22:37, denisgolovan via Lazarus wrote:
> Hi all
>
> Recently, I've started experiencing rather nasty bug - my GUI application started freezing when scrolling VirtualTreeView component vertically using scrollbar.
> VTV itself is rather old version (last commit from May 17 2015). FPC and Lazarus are from trunk, svn rev.35396 and rev.54204.
> I am under Gentoo x64, gtk2 widgetset, gtk+ library v2.24.31-r1.
>
> When paused after freezing, callstack always shows the following stack trace. So I assume there is some infinite loop running.
>
> #0 poll at :0
> #1 ?? at :0
> #2 ?? at :0
> #3 xcb_wait_for_reply at :0
> #4 _XReply at :0
> #5 XGetGeometry at :0
> #6 gdk_window_get_frame_extents at :0
> #7 gdk_window_get_root_origin at :0
> #8 GETWIDGETRELATIVEPOSITION(0x7fffed8cc490, 0, 0) at gtk2/gtk2proc.inc:7001
> #9 SENDSIZENOTIFICATIONTOLCL(0x7fffed8cc490) at gtk2/gtk2proc.inc:6530
> #10 GTKSIZE_ALLOCATECB(0x7fffed8cc490, 0x7fffffffcd20, 0x7fffed90a040) at gtk2/gtk2callback.inc:2530
> #11 g_closure_invoke(0x7fffed93ac50, 0x0, 0x0, 2, 0x7fffffffcab0, 0x7fffffffcab0, 0x7fffffffca50, 0x7fffffffca50) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/gobject/gclosure.c:804
> #12 signal_emit_unlocked_R(0x7fffee036f40, 0x7fffee036f40, 0, 0, 0x7fffed8cc490, 0x7fffed8cc490, 0x0, 0x0, 0x7fffffffcab0, 0x7fffffffcab0) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/gobject/gsignal.c:3629
> #13 g_signal_emit_valist(<optimized out>, <optimized out>, <optimized out>, 0x7fffffffcc40, 0x7fffffffcc40) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/gobject/gsignal.c:3385
> #14 g_signal_emit(<optimized out>, <optimized out>, <optimized out>) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/gobject/gsignal.c:3441
> #15 gtk_widget_size_allocate at :0
> #16 ?? at :0
> #17 _g_closure_invoke_va(0x7fffed8c96a0, 0x7fffed8c96a0, 0x0, 0x0, 0x7fffed8cc490, 0x7fffed8cc490, 0x7fffffffd060, 0x7fffffffd060, <optimized out>, 0x0) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/gobject/gclosure.c:867
> #18 g_signal_emit_valist(0x7fffed8cc490, <optimized out>, 0, 0x7fffffffd060, 0x7fffffffd060) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/gobject/gsignal.c:3294
> #19 g_signal_emit(<optimized out>, <optimized out>, <optimized out>) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/gobject/gsignal.c:3441
> #20 ?? at :0
> #21 ?? at :0
> #22 g_main_dispatch(0x7fffee0442c0) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/glib/gmain.c:3154
> #23 g_main_context_dispatch(0x7fffee0442c0, 0x7fffee0442c0) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/glib/gmain.c:3769
> #24 g_main_context_iterate(0x7fffee0442c0, 0x7fffee0442c0, 0, 0, 1, 1, <optimized out>) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/glib/gmain.c:3840
> #25 g_main_context_iteration(0x7fffee0442c0, 0) at /var/tmp/paludis/dev-libs-glib-2.48.2/work/glib-2.48.2/glib/gmain.c:3901
> #26 APPPROCESSMESSAGES(0x7fffee1b6040) at gtk2/gtk2widgetset.inc:2328
> #27 HANDLEMESSAGE(0x7fffee079540) at include/application.inc:1274
> #28 RUNLOOP(0x7fffee079540) at include/application.inc:1411
> #29 APPRUN(0x7fffee1b6040, {Proc = {procedure (POINTER)} 0x7fffffffd430, Self = 0x7fffee079540}) at include/interfacebase.inc:54
> #30 RUN(0x7fffee079540) at include/application.inc:1399
>
> Any hints on how to resolve?
>

Can you try attached unit source file? You need to add in your main 
program sources before any LCL units and after cthreads/cmem units.
-------------- next part --------------
unit unix_init_xlib;

{$mode objfpc}{$H+}

interface

implementation

uses
   xlib;

Var
  AStatus : TStatus;

initialization
   AStatus := XInitThreads;
   AStatus := AStatus;

finalization

end.



More information about the Lazarus mailing list