Sign in Join

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

Mailing lists / lazarus / 2010-10

Need testers (gtk2)

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

zeljko

Hi,
I've commited an important patch today (r 27829) , about gtk2 main loop iterations.
Now it uses g_main_context instead of g_main which is deprecated from gtk2-2.2.
This patch improves main loop, but also now PostMessage() works fine for messages from another threads.

*** Gtk2 Laz/LCL must be build with -dUSE_GTK_MAIN_CONTEXT_ITERATION *** to get this new code work.

If you find any issues about it, please open it's while I'll set USE_GTK_MAIN_CONTEXT_ITERATION as default, so -d won't be needed anymore.

I've tested under: Fedora 3 (gtk2-2.12), Fedora 13 (gtk2-2.20), Ubuntu 10.4 64bit (gtk2-2.20).
Gtk2 version isn't important here, but glib2 version is, so if you open any issue about main loop problems, please provide next informations:

1.Linux distribution & version + 32 or 64 bit
2.Gtk2 version
3.Glib2 version.
4.Provide an simple example where I can reproduce your problem.

thanks.

thanks
zeljko

Reply by email

Juha Manninen
to zeljko
zeljko wrote 10 lines
Hi, I've commited an important patch today (r 27829) , about gtk2 main loop iterations. Now it uses g_main_context instead of g_main which is deprecated from gtk2-2.2. This patch improves main loop, but also now PostMessage() works fine for messages from another threads. *** Gtk2 Laz/LCL must be build with -dUSE_GTK_MAIN_CONTEXT_ITERATION *** to get this new code work.

In my short tests it works well. I didn't notice difference for older versions. I will try PostMessage later.

I just happened to debug a GTK2 program. It is the thtmlport package from CCR. It looks like a useful package but it crashes with GTK2. This bug seems to be extremely difficult to find. It shows this:

(lazarus:2791): Gdk-CRITICAL **: gdk_window_get_state: assertion `GDK_IS_WINDOW (window)' failed
[DBGTGT] Gdk-ERROR **: The program 'framedem' received an X Window System error.
[DBGTGT] This probably reflects a bug in the program. [DBGTGT] The error was 'BadMatch (invalid parameter attributes)'. [DBGTGT] (Details: serial 2256 error_code 8 request_code 62 minor_code 0) [DBGTGT] (Note to programmers: normally, X errors are reported asynchronously;
[DBGTGT] that is, you will receive the error a while after causing it. [DBGTGT] To debug your program, run it with the --sync command line [DBGTGT] option to change this behavior. You can then get a meaningful [DBGTGT] backtrace from your debugger if you break on the gdk_x_error() function.)
[DBGTGT] aborting...

Question: how can I give --sync parameter for the program when I run it under gdb? I tried:

$ gdb 'framedem --sync'
which says:
framedem --sync: No such file or directory.

and:

$ gdb framedem --sync
which says:
gdb: unrecognized option '--sync'
Use `gdb --help' for a complete list of options.

I can give the parameter in Lazarus "Run Parameters..." but then the whole Lazarus freezes. It doesn't take mouse clicks and must be killed.

Juha

Reply by email

Mark Morgan Lloyd
to Juha Manninen
Juha Manninen wrote 16 lines
Question: how can I give --sync parameter for the program when I run it under gdb? I tried: $ gdb 'framedem --sync' which says: framedem --sync: No such file or directory. and: $ gdb framedem --sync which says: gdb: unrecognized option '--sync' Use `gdb --help' for a complete list of options. I can give the parameter in Lazarus "Run Parameters..." but then the whole Lazarus freezes. It doesn't take mouse clicks and must be killed.

From my limited experience with general debugging, try

gdb framedem
(gdb) set args --sync
(gdb) run

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

zeljko
to Juha Manninen: In my short tests it works well. I didn't notice difference for older versions. I will…
Juha Manninen wrote 14 lines
On Sunday 24 October 2010 15:24:04 zeljko wrote: > Hi, > I've commited an important patch today (r 27829) , about gtk2 main loop > iterations. > Now it uses g_main_context instead of g_main which is deprecated from > gtk2-2.2. > This patch improves main loop, but also now PostMessage() works fine for > messages from another threads. > > *** Gtk2 Laz/LCL must be build with -dUSE_GTK_MAIN_CONTEXT_ITERATION *** > to get this new code work. In my short tests it works well. I didn't notice difference for older versions. I will try PostMessage later.

This update is mostly commited because of PostMessage() :), but also affects unthreaded apps, because our message queue does not rely on critical sections, but parallel g_main_context, which is more effective in multi threaded environment.

Show quoted text 7 lines
$ gdb framedem --sync which says: gdb: unrecognized option '--sync' Use `gdb --help' for a complete list of options. I can give the parameter in Lazarus "Run Parameters..." but then the whole Lazarus freezes. It doesn't take mouse clicks and must be killed.

Isn't standard X11 param with one - eg. ./myprogram -sync ?

zeljko

Reply by email

waldo kitty
to zeljko
zeljko wrote 5 lines
On Sunday 24 October 2010 15:32, Juha Manninen wrote: > I can give the parameter in Lazarus "Run Parameters..." but then the whole > Lazarus freezes. It doesn't take mouse clicks and must be killed. Isn't standard X11 param with one - eg. ./myprogram -sync ?

full word params has two dashes... single character params have one dash...

foo -V
foo --version

the above might return the same result in program foo...

Reply by email

zeljko
to waldo kitty
waldo kitty wrote 13 lines
On 10/24/2010 11:53, zeljko wrote: > On Sunday 24 October 2010 15:32, Juha Manninen wrote: >> I can give the parameter in Lazarus "Run Parameters..." but then the >> whole Lazarus freezes. It doesn't take mouse clicks and must be killed. > > Isn't standard X11 param with one - eg. ./myprogram -sync ? full word params has two dashes... single character params have one dash... foo -V foo --version the above might return the same result in program foo...

Are you sure ? I'm talking about XOrg standard params, not about gtk2 or any other ws ...
xterm -sync -> works ok
xterm --sync -> doesn't work

zeljko

Reply by email

Juha Manninen
to waldo kitty: full word params has two dashes... single character params have one dash... foo -V foo…
waldo kitty wrote 8 lines
> Isn't standard X11 param with one - eg. ./myprogram -sync ? full word params has two dashes... single character params have one dash... foo -V foo --version the above might return the same result in program foo...

Thanks Marc and Felipe for your help.
Both "run --sync" and "set args --sync" work equally well.

Zeljan, I tested also a single dash (-sync) but it doesn't work. It says:

Starting program: /home/juha/SW/Pascal/thtmlport2/demo_src/framedem -sync [Thread debugging using libthread_db enabled]
Detaching after fork from child process 4763.
Detaching after fork from child process 4764.
TApplication.HandleException Can't locate file: -sync Stack trace:
$0000000000849E34 line 2600 of framview.pas
...

and the stack trace is not very helpfull.

With double dash it gives the following stack trace. Note: I don't expect anyone else to solve it. It is here just for curiosity. I must say I am little obsessed with this bug now...
And sorry for hijacking this thread, I will get back to the original issue later.

Juha

---------------------------------------

Program received signal SIGABRT, Aborted.
0x00000032df0329a5 in raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); Missing separate debuginfos, use: debuginfo-install atk-1.30.0-1.fc13.x86_64 cairo-1.8.10-1.fc13.x86_64 expat-2.0.1-10.fc13.x86_64 fontconfig-2.8.0-1.fc13.x86_64 freetype-2.3.11-6.fc13.x86_64 gtk2-2.20.1-1.fc13.x86_64 libXcomposite-0.4.1-2.fc13.x86_64 libXdamage-1.1.2-2.fc13.x86_64 libXi-1.3.2-1.fc13.x86_64 libXinerama-1.1-2.fc13.x86_64 libXrandr-1.3.0-5.fc13.x86_64 libselinux-2.0.94-2.fc13.x86_64 libxcb-1.5-1.fc13.x86_64 pango-1.28.0-1.fc13.x86_64 pixman-0.18.0-1.fc13.x86_64 qtcurve- gtk2-1.6.3-1.fc13.x86_64
(gdb) bt
#0 0x00000032df0329a5 in raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00000032df034185 in abort () at abort.c:92
#2 0x00000032e084668a in IA__g_logv (log_domain=0x3d5cc7f2d4 "Gdk", log_level=<value optimized out>, format=0x3d5cc9d567 "%s", args1=0x7fffffff9ed0) at gmessages.c:549
#3 0x00000032e0846723 in IA__g_log (log_domain=<value optimized out>, log_level=<value optimized out>, format=<value optimized out>) at gmessages.c:569
#4 0x0000003d5cc686e6 in ?? () from /usr/lib64/libgdk-x11-2.0.so.0 #5 0x00000032e1446b24 in _XError (dpy=0xe68a00, rep=0x1105080) at XlibInt.c:3103
#6 0x00000032e144cf7c in process_responses (dpy=0xe68a00, wait_for_first_event=0, current_error=0x7fffffffa1c0, current_request=2319) at xcb_io.c:214
#7 0x00000032e144d610 in _XReply (dpy=0xe68a00, rep=0x7fffffffa210, extra=0, discard=1) at xcb_io.c:464
#8 0x00000032e1441093 in XSync (dpy=0xe68a00, discard=0) at Sync.c:48 #9 0x00000032e144124b in _XSyncFunction (dpy=<value optimized out>) at Synchro.c:37
#10 0x00000032e1420740 in XCopyArea (dpy=0xe68a00, src_drawable=106955094, dst_drawable=106955100, gc=0x10e98b0, src_x=0, src_y=0, width=16, height=16, dst_x=0, dst_y=0) at CopyArea.c:63
#11 0x0000003d5cc2319c in gdk_draw_drawable () from /usr/lib64/libgdk- x11-2.0.so.0
#12 0x0000000000775ed1 in GDK2_GDK_DRAW_PIXMAP$crcB87764AF () #13 0x0000000000776d18 in GDK2_GDK_WINDOW_COPY_AREA$crcDE8FE071 () #14 0x00000000006b7fad in SCALEANDROP (parentfp=0x7fffffffa610, DESTGC=0x10f9950, SRC=0x10e2920, SRCPIXMAP=0x10e2920, SRCMASKBITMAP=0x0) at gtk2widgetset.inc:3824
#15 0x00000000006b79f2 in SRCDEVBITMAPTODRAWABLE (parentfp=0x7fffffffa610) at gtk2widgetset.inc:3920
#16 0x00000000006b780d in DRAWABLETODRAWABLE (parentfp=0x7fffffffa610) at gtk2widgetset.inc:3984
#17 0x00000000006b7355 in STRETCHCOPYAREA (this=0x7ffff7f8c170, DESTDC=140737244692816, X=0, Y=0, WIDTH=16, HEIGHT=16, SRCDC=140737244696496, XSRC=0, YSRC=0, SRCWIDTH=16, SRCHEIGHT=16,
MASK=0, XMASK=0, YMASK=0, ROP=3342344) at gtk2widgetset.inc:4261 #18 0x00000000006d5ec8 in STRETCHBLT (this=0x7ffff7f8c170, DESTDC=140737244692816, X=0, Y=0, WIDTH=16, HEIGHT=16, SRCDC=140737244696496, XSRC=0, YSRC=0, SRCWIDTH=16, SRCHEIGHT=16, ROP=
3342344) at gtk2winapi.inc:9086
#19 0x00000000006bcfb5 in BITBLT (this=0x7ffff7f8c170, DESTDC=140737244692816, X=0, Y=0, WIDTH=16, HEIGHT=16, SRCDC=140737244696496, XSRC=0, YSRC=0, ROP=3342344) at gtk2winapi.inc:184
#20 0x000000000058215c in BITBLT (DESTDC=140737244692816, X=0, Y=0, WIDTH=16, HEIGHT=16, SRCDC=140737244696496, XSRC=0, YSRC=0, ROP=3342344) at include/winapi.inc:53
#21 0x00000000008981ba in FINISHTRANSPARENTBITMAP (AHDC=140737244610128, INIMAGE=0x7ffff7f85fc0, MASK=0x7ffff7f860c0, XSTART=104, YSTART=299, W=16, H=16) at htmlun2.pas:2346
#22 0x0000000000865ef8 in DODRAW (this=0x7ffff1ed78c0, CANVAS=0x7ffff174b100, XX=104, Y=299, DDIMAGE=0x7ffff7f85fc0, DDMASK=0x7ffff7f860c0) at htmlsubs.pas:2643 #23 0x00000000008665ad in DRAW (this=0x7ffff1ed78c0, CANVAS=0x7ffff174b100, X=100, TOPY=303, YBASELINE=315, FO=0x7ffff17c95c0) at htmlsubs.pas:2764 #24 0x000000000088bcb7 in DRAWTHETEXT (parentfp=0x7fffffffaf10, LINENO=0) at htmlsubs.pas:11276
#25 0x000000000088b489 in DODRAW (parentfp=0x7fffffffaf10, I=0) at htmlsubs.pas:11658
#26 0x000000000088b322 in DRAW1 (this=0x7ffff19633a0, CANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=100, XREF=0, YREF=0) at htmlsubs.pas:11702 #27 0x00000000008732b0 in DRAWTHELIST (this=0x7ffff179a830, ACANVAS=0x7ffff174b100, ARECT=..., CLIPWIDTH=1100, X=100, XREF=0, YREF=0) at htmlsubs.pas:5578
#28 0x0000000000872e56 in DRAWBLOCK (this=0x7ffff179a830, ACANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=100, Y=294, XREF=0, YREF=0) at htmlsubs.pas:5531
#29 0x0000000000871cac in DRAW1 (this=0x7ffff179a830, ACANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=100, XREF=0, YREF=0) at htmlsubs.pas:5347 #30 0x000000000087630b in DRAW1 (this=0x7ffff179a830, CANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=100, XREF=0, YREF=0) at htmlsubs.pas:6188 #31 0x00000000008732b0 in DRAWTHELIST (this=0x7ffff1799c30, ACANVAS=0x7ffff174b100, ARECT=..., CLIPWIDTH=1100, X=100, XREF=0, YREF=0) at htmlsubs.pas:5578
#32 0x0000000000872e56 in DRAWBLOCK (this=0x7ffff1799c30, ACANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=100, Y=294, XREF=0, YREF=0) at htmlsubs.pas:5531
#33 0x0000000000871cac in DRAW1 (this=0x7ffff1799c30, ACANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=65, XREF=0, YREF=0) at htmlsubs.pas:5347 #34 0x00000000008732b0 in DRAWTHELIST (this=0x7ffff1799010, ACANVAS=0x7ffff174b100, ARECT=..., CLIPWIDTH=1135, X=65, XREF=0, YREF=0) at htmlsubs.pas:5578
#35 0x0000000000872e56 in DRAWBLOCK (this=0x7ffff1799010, ACANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=65, Y=279, XREF=0, YREF=0) at htmlsubs.pas:5531
#36 0x0000000000871cac in DRAW1 (this=0x7ffff1799010, ACANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=65, XREF=0, YREF=0) at htmlsubs.pas:5347 #37 0x000000000087630b in DRAW1 (this=0x7ffff1799010, CANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=65, XREF=0, YREF=0) at htmlsubs.pas:6188 #38 0x00000000008732b0 in DRAWTHELIST (this=0x7ffff1797db0, ACANVAS=0x7ffff174b100, ARECT=..., CLIPWIDTH=1135, X=65, XREF=0, YREF=0) at htmlsubs.pas:5578
#39 0x0000000000872e56 in DRAWBLOCK (this=0x7ffff1797db0, ACANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=65, Y=235, XREF=0, YREF=0) at htmlsubs.pas:5531
#40 0x0000000000871cac in DRAW1 (this=0x7ffff1797db0, ACANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=30, XREF=0, YREF=0) at htmlsubs.pas:5347 #41 0x00000000008732b0 in DRAWTHELIST (this=0x7ffff178c570, ACANVAS=0x7ffff174b100, ARECT=..., CLIPWIDTH=1170, X=30, XREF=0, YREF=0) at htmlsubs.pas:5578
#42 0x00000000008770f6 in DRAW1 (this=0x7ffff178c570, CANVAS=0x7ffff174b100, ARECT=..., IMGR=0x7ffff17692c0, X=30, XREF=0, YREF=0) at htmlsubs.pas:6353 #43 0x000000000086df62 in DRAW (this=0x7ffff176e010, CANVAS=0x7ffff174b100, ARECT=..., CLIPWIDTH=6000, X=0, Y=0, XREF=0, YREF=0) at htmlsubs.pas:4379 #44 0x00000000008913a4 in DRAW (this=0x7ffff176e010, CANVAS=0x7ffff174b100, ARECT=..., CLIPWIDTH=6000, X=0, Y=0, XREF=0, YREF=0) at htmlsubs.pas:12475 #45 0x0000000000878e1f in DRAW (this=0x7ffff176e010, CANVAS=0x7ffff174b100, ARECT=..., CLIPWIDTH=6000, X=0, Y=0, XREF=0, YREF=0) at htmlsubs.pas:6797 #46 0x0000000000854c8e in HTMLPAINT (this=0x7ffff176c950, SENDER=0x7ffff176d3d0) at htmlview.pas:1252
#47 0x000000000086092a in PAINT (this=0x7ffff176d3d0) at htmlview.pas:5035 #48 0x00000000006821df in PAINTWINDOW (this=0x7ffff176d3d0, DC=140737244611312) at include/customcontrol.inc:133
#49 0x0000000000663ab3 in PAINTHANDLER (this=0x7ffff176d3d0, THEMESSAGE=...) at include/wincontrol.inc:4672
#50 0x0000000000669a09 in WMPAINT (this=0x7ffff176d3d0, MSG=...) at include/wincontrol.inc:6524
#51 0x0000000000682083 in WMPAINT (this=0x7ffff176d3d0, MESSAGE=...) at include/customcontrol.inc:113
#52 0x00000000004b1205 in SYSTEM_TOBJECT_$__DISPATCH$formal ()

Reply by email

waldo kitty
to zeljko: Are you sure ? I'm talking about XOrg standard params, not about gtk2 or any other ws ...…
zeljko wrote 20 lines
On Sunday 24 October 2010 17:56, waldo kitty wrote: > On 10/24/2010 11:53, zeljko wrote: >> On Sunday 24 October 2010 15:32, Juha Manninen wrote: >>> I can give the parameter in Lazarus "Run Parameters..." but then the >>> whole Lazarus freezes. It doesn't take mouse clicks and must be killed. >> >> Isn't standard X11 param with one - eg. ./myprogram -sync ? > > full word params has two dashes... single character params have one dash... > > foo -V > foo --version > > the above might return the same result in program foo... Are you sure ? I'm talking about XOrg standard params, not about gtk2 or any other ws ... xterm -sync -> works ok xterm --sync -> doesn't work

ahhh... my bad i guess... i was speaking in *nix generalities... interesting that xterm doesn't follow like most every other common *nix program...

Reply by email