[Gtk-sharp-list] Changing widgets visual properties (wiewport backgrounds, labels) bug

Piotr Budny piotr.budny at gmail.com
Sun Apr 26 10:28:19 EDT 2009


Hello,
I have got problems with changing widget properties (e.g. backgrounds, text 
labels and so on).

Short example from http://chimera.one.pl/shack/testbg.tar.gz (project created 
with monodevelop) causes random crashes, hang ups (see below).

The program generates three custom widgets in MainWindow, it also creates 
Thread, which sends signal (tested with 50 ms, 500 ms, ...) to the widgets to 
change label.Text and modifies background colour.
I tried to get rid of custom widgets too, and update Gtk.Labels, but the 
program still SIGSEGV'ed.

I don't really know what is it related with (maybe xorg, xorg libs, gtk, ...)
I'm using PLD-Linux (mono 2.0.1, 2.4), but this was tested with latest Ubuntu.

Besides, when changing in Test.cs:
	public partial class Test : Gtk.Bin
to
	public partial class Test : Gtk.Viewport
widgets aren't properly displayed.

How to trace this error? Or maybe I am doing something wrong? Somebody 
familiar with this bug?

Best regards,
Piotr Budny


The stacktraces:

[16:08 vip at dzibutti:.../csharp/testbg/bin/Debug]% LANG=C ./testbg.exe
mono: XlibInt.c:599: _XPrivSyncFunction: Assertion `dpy->synchandler == 
_XPrivSyncFunction' failed.
Stacktrace:                                                                                        

  at (wrapper managed-to-native) Gtk.Widget.gtk_widget_modify_bg 
(intptr,int,intptr) <0x00004>
  at (wrapper managed-to-native) Gtk.Widget.gtk_widget_modify_bg 
(intptr,int,intptr) <0xffffffff>
  at Gtk.Widget.ModifyBg (Gtk.StateType,Gdk.Color) <0x00051>                                     
  at testbg.Test.OnChanged (string) <0x000d9>                                                    
  at (wrapper delegate-invoke) 
testbg.ChangedEventHandler.invoke_void__this___string (string) <0x00064>
  at (wrapper delegate-invoke) 
testbg.ChangedEventHandler.invoke_void__this___string (string) <0x00064>
  at (wrapper delegate-invoke) 
testbg.ChangedEventHandler.invoke_void__this___string (string) <0xffffffff>
  at testbg.Sig.ThreadProc () <0x00030>                                                                   
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ 
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        /usr/bin/mono [0x80c3de7]
        [0xffffe40c]            

[...]

Thread 1 (Thread 0xb7e19900 (LWP 22264)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7f1190f in *__GI___poll (fds=0x8323c78, nfds=2, timeout=-1) at 
../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb801deef in IA__g_poll (fds=0x8323c78, nfds=2, timeout=-1) at 
gpoll.c:127
#3  0xb801169c in g_main_context_poll (n_fds=<value optimized out>, fds=<value 
optimized out>, priority=<value optimized out>,
    timeout=<value optimized out>, context=<value optimized out>) at 
gmain.c:2761
#4  g_main_context_iterate (n_fds=<value optimized out>, fds=<value optimized 
out>, priority=<value optimized out>, timeout=<value optimized out>,
    context=<value optimized out>) at gmain.c:2443
#5  0xb8011c6c in IA__g_main_loop_run (loop=0x841b8f0) at gmain.c:2656
#6  0xb712bcc4 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#7  0xb6a22bc8 in ?? ()
#8  0x00000000 in ?? ()

(testbg:22264): Gdk-CRITICAL **: gdk_gc_set_clip_rectangle: assertion 
`GDK_IS_GC (gc)' failed

(testbg:22264): Gdk-CRITICAL **: gdk_draw_rectangle: assertion `GDK_IS_GC 
(gc)' failed

(testbg:22264): Gdk-CRITICAL **: gdk_gc_set_clip_rectangle: assertion 
`GDK_IS_GC (gc)' failed

or

(testbg:22356): Gtk-CRITICAL **: gtk_container_check_resize: assertion 
`GTK_IS_CONTAINER (container)' failed
Stacktrace:                                                                                                 


Native stacktrace:

        /usr/bin/mono [0x80c3de7]
        /usr/bin/mono [0x80ed36d]
        [0xffffe40c]             

[...]

Thread 4 (Thread 0xb80b7b90 (LWP 22358)):
#0  0xffffe424 in __kernel_vsyscall ()   
#1  0xb7fe4b06 in nanosleep () from /lib/libpthread.so.0
#2  0x0819357a in collection_thread ()                  
#3  0xb7fddfff in start_thread (arg=0x0) at pthread_create.c:297
#4  0xb7fddf1a in __free_tcb (pd=0x0) at pthread_create.c:216   
#5  0xb7f3d18e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133

Thread 3 (Thread 0xb77efb90 (LWP 22359)):
#0  0xffffe424 in __kernel_vsyscall ()   
#1  0xb7fe3735 in sem_wait@@GLIBC_2.1 () at 
../nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S:80
#2  0x08121bb7 in finalizer_thread ()                                                              
#3  0x08143e73 in start_wrapper ()
#4  0x081ae5ae in thread_start_routine ()
#5  0x081cb4d0 in GC_start_routine ()
#6  0xb7fddfff in start_thread (arg=0x0) at pthread_create.c:297
#7  0xb7fddf1a in __free_tcb (pd=0x0) at pthread_create.c:216
#8  0xb7f3d18e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133

Thread 2 (Thread 0xb68ffb90 (LWP 22360)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7fe430b in read () from /lib/libpthread.so.0
#2  0x080c3f55 in mono_handle_native_sigsegv ()
#3  0x080ed36d in mono_arch_handle_altstack_exception ()
#4  <signal handler called>
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 1 (Thread 0xb7e3b900 (LWP 22356)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7f3390f in *__GI___poll (fds=0x8418878, nfds=2, timeout=480) at 
../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb803feef in IA__g_poll (fds=0x8418878, nfds=2, timeout=480) at 
gpoll.c:127
#3  0xb803369c in g_main_context_poll (n_fds=<value optimized out>, fds=<value 
optimized out>, priority=<value optimized out>,
    timeout=<value optimized out>, context=<value optimized out>) at 
gmain.c:2761
#4  g_main_context_iterate (n_fds=<value optimized out>, fds=<value optimized 
out>, priority=<value optimized out>, timeout=<value optimized out>,
    context=<value optimized out>) at gmain.c:2443
#5  0xb8033c6c in IA__g_main_loop_run (loop=0x841bc30) at gmain.c:2656
#6  0xb714dcc4 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#7  0xb6a44b80 in ?? ()Thread 4 (Thread 0xb80b7b90 (LWP 22358)):
#0  0xffffe424 in __kernel_vsyscall ()   
#1  0xb7fe4b06 in nanosleep () from /lib/libpthread.so.0
#2  0x0819357a in collection_thread ()                  
#3  0xb7fddfff in start_thread (arg=0x0) at pthread_create.c:297
#4  0xb7fddf1a in __free_tcb (pd=0x0) at pthread_create.c:216   
#5  0xb7f3d18e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133

#8  0x00000000 in ?? ()


or


The program 'testbg' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRequest (invalid request code or no such operation)'.
  (Details: serial 2863 error_code 1 request_code 122 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)



More information about the Gtk-sharp-list mailing list