[Mono-bugs] [Bug 77786][Nor] New - Intermittent error wehn Updating
progress bar from another Thread
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Tue Mar 14 06:26:55 EST 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by sqeaky at blacktoppstudios.com.
http://bugzilla.ximian.com/show_bug.cgi?id=77786
--- shadow/77786 2006-03-14 06:26:55.000000000 -0500
+++ shadow/77786.tmp.17076 2006-03-14 06:26:55.000000000 -0500
@@ -0,0 +1,290 @@
+Bug#: 77786
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: Fedora core 4, kernel 2.6.15-1.1833_FC4, WM Fluxbox
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: sqeaky at blacktoppstudios.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Intermittent error wehn Updating progress bar from another Thread
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Whenever I try to update a progress bar from another thread, I frequently
+get this error.
+"Xlib: unexpected async reply (sequence 0x146)!"
+The value in the sequence xxxxx seems to vary in an unpredictable fashion.
+
+Steps to reproduce the problem:
+1. Use this code, this is code from an actual project I am doing for a
+client, however I have removed much extraneous code that is uneeded to get
+this bug.
+code
+
+using Gtk;
+using GtkSharp;
+using System;
+using System.IO;
+using System.Collections;
+using System.Threading;
+
+class main {
+ static ProgressBar Pbar;
+ static Thread ParseThread;
+ static Window window;
+
+ static void Main()
+ {
+ Application.Init ();
+
+ window = new Window ("Patient Billing");
+ window.DeleteEvent += new DeleteEventHandler (delete_event);//Adds window
+close method
+ VBox VBoxOuter = new VBox(false,0);
+ Widget patientbilling = new Label("Progress bar thread bug");
+ VBoxOuter.PackStart(patientbilling,true,false,0);
+ Pbar = new ProgressBar();
+ VBoxOuter.PackStart(Pbar,true,false,0);
+
+ ParseThread = new Thread(new ThreadStart(ParseDetectedFiles));
+ ParseThread.Start();
+
+ //Prepare Window
+ window.Add (VBoxOuter);
+ window.ShowAll ();
+ Pbar.QueueDraw();
+
+ Application.Run ();
+ }
+
+ static void ParseDetectedFiles()
+ {
+ Log("Begin Parsing:");
+ double TotalLength = 1000000;
+ for(double i = 1;i<TotalLength ;i++)
+ {
+ Pbar.Fraction=i/TotalLength;
+ Pbar.QueueDraw();
+ //window.QueueDraw();
+ Log(i + "/" + TotalLength + " = " + i/TotalLength);
+ Thread.Sleep(0);
+ }
+ Log("Finished if you didn't get the bug try it again");
+ }
+
+ static void Log(string Message)
+ {
+ Console.WriteLine(Message);
+ //loggin to file removed
+ }
+
+ static void delete_event (object obj, DeleteEventArgs args)
+ {
+ ParseThread.Abort();
+ Application.Quit ();
+ }
+}
+
+/code
+2. I compiled with "mcs bug.cs -pkg:gtk-sharp -out:PatientBilling.exe5"
+3. And ran it with "mono PatientBilling.exe"
+
+
+Actual Results:
+The application execution appears to halt, files being written do not
+complete, and when I ctrl+c the program it does this
+error
+
+3643/1000000 = 0.003643
+3644/1000000 = 0.003644
+3645/1000000 = 0.003645
+Xlib: unexpected async reply (sequence 0x146)!
+
+(<unknown>:1159): Gdk-CRITICAL **: gdk_gc_get_values: assertion `GDK_IS_GC
+(gc)'
+ failed
+
+=================================================================
+Got a SIGSEGV while executing native code. This usually indicates
+a fatal error in the mono runtime or one of the native libraries
+used by your application.
+=================================================================
+
+Stacktrace:
+
+in (wrapper managed-to-native)
+Gtk.ProgressBar:gtk_progress_bar_set_fraction (in
+tptr,double) <0x4>
+in (wrapper managed-to-native)
+Gtk.ProgressBar:gtk_progress_bar_set_fraction (in
+tptr,double) <0xffffffe0>
+in Gtk.ProgressBar:set_Fraction (double) <0x20>
+in main:ParseDetectedFiles () <0x54>
+in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()
+<0xffffff90
+>
+in (wrapper runtime-invoke) System.Object:runtime_invoke_void
+(object,intptr,int
+ptr,intptr) <0x7d9e47f>
+
+Native stacktrace:
+
+ mono(mono_handle_native_sigsegv+0xbb) [0x814ee2b]
+ mono [0x813b2cf]
+ [0xb12440]
+
+/usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so(cl_draw_rectangle+0x245)
+ [0xd449d5]
+ /usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so [0xd3e15d]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_paint_box+0x8d) [0x35d3702]
+ /usr/lib/libgtk-x11-2.0.so.0 [0x35a74b1]
+ /usr/lib/libgtk-x11-2.0.so.0 [0x35a7c99]
+ /usr/lib/libgtk-x11-2.0.so.0 [0x35a5845]
+ /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x47)
+[0x4a77
+e7]
+ /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x10a) [0x49c285]
+ /usr/lib/libgobject-2.0.so.0 [0x4aa75b]
+ /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x6ab) [0x4abeb0]
+ /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0x4ac223]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_adjustment_value_changed+0x53)
+[0x34bd8
+57]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_adjustment_set_value+0xab) [0x34bd944]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_progress_set_value+0x9c) [0x35a5d5f]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_progress_set_percentage+0xc4)
+[0x35a5e3
+f]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_progress_bar_set_fraction+0x5e)
+[0x35a8
+26b]
+ [0x3a1c1b]
+ [0x3a1bc9]
+ [0x39cf95]
+ [0x39cdd0]
+ [0x39cd29]
+ mono [0x813b180]
+ mono(mono_runtime_invoke+0x27) [0x80d63f7]
+ mono(mono_runtime_delegate_invoke+0x3b) [0x80d6e2b]
+ mono [0x8099ffb]
+ mono [0x80f5067]
+ mono [0x8113175]
+ /lib/libpthread.so.0 [0x117b80]
+ /lib/libc.so.6(__clone+0x5e) [0x8ef9ce]
+Aborted
+
+/error
+
+here is another instance of the error
+
+error
+
+7657/1000000 = 0.007657
+Xlib: unexpected async reply (sequence 0x2c105)!
+
+(<unknown>:2246): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion
+`G_IS_OBJECT (object)' failed
+
+(<unknown>:2246): Gdk-CRITICAL **: gdk_colormap_get_visual: assertion
+`GDK_IS_COLORMAP (colormap)' failed
+
+(<unknown>:2246): Gdk-CRITICAL **: gdk_visual_get_screen: assertion
+`GDK_IS_VISUAL (visual)' failed
+
+=================================================================
+Got a SIGSEGV while executing native code. This usually indicates
+a fatal error in the mono runtime or one of the native libraries
+used by your application.
+=================================================================
+
+Stacktrace:
+
+in (wrapper managed-to-native)
+Gtk.ProgressBar:gtk_progress_bar_set_fraction (intptr,double) <0x4>
+in (wrapper managed-to-native)
+Gtk.ProgressBar:gtk_progress_bar_set_fraction (intptr,double) <0xffffffe0>
+in Gtk.ProgressBar:set_Fraction (double) <0x20>
+in main:ParseDetectedFiles () <0x54>
+in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()
+<0xffffff90>
+in (wrapper runtime-invoke) System.Object:runtime_invoke_void
+(object,intptr,intptr,intptr) <0x7c4947f>
+
+Native stacktrace:
+
+ mono(mono_handle_native_sigsegv+0xbb) [0x814ee2b]
+ mono [0x813b2cf]
+ [0xccb440]
+ /usr/lib/libgdk-x11-2.0.so.0 [0xa54cd5]
+ /usr/lib/libgdk-x11-2.0.so.0(gdk_rgb_find_color+0x22) [0xa54e2f]
+
+/usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so(draw_hgradient+0x393)
+[0xc966a0]
+
+/usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so(cl_progressbar_tile_new+0x10b)
+[0xc978b6]
+
+/usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so(cl_progressbar_fill+0x66)
+[0xc97bb9]
+ /usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so [0xc9153a]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_paint_box+0x8d) [0x35d3702]
+ /usr/lib/libgtk-x11-2.0.so.0 [0x35a767a]
+ /usr/lib/libgtk-x11-2.0.so.0 [0x35a7c99]
+ /usr/lib/libgtk-x11-2.0.so.0 [0x35a5845]
+ /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x47)
+[0x7ab7e7]
+ /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x10a) [0x7a0285]
+ /usr/lib/libgobject-2.0.so.0 [0x7ae75b]
+ /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x6ab) [0x7afeb0]
+ /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0x7b0223]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_adjustment_value_changed+0x53)
+[0x34bd857]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_adjustment_set_value+0xab) [0x34bd944]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_progress_set_value+0x9c) [0x35a5d5f]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_progress_set_percentage+0xc4)
+[0x35a5e3f]
+ /usr/lib/libgtk-x11-2.0.so.0(gtk_progress_bar_set_fraction+0x5e)
+[0x35a826b]
+ [0x4f6c1b]
+ [0x4f6bc9]
+ [0x4f1f95]
+ [0x4f1dd0]
+ [0x4f1d29]
+ mono [0x813b180]
+ mono(mono_runtime_invoke+0x27) [0x80d63f7]
+ mono(mono_runtime_delegate_invoke+0x3b) [0x80d6e2b]
+ mono [0x8099ffb]
+ mono [0x80f5067]
+ mono [0x8113175]
+ /lib/libpthread.so.0 [0xb09b80]
+ /lib/libc.so.6(__clone+0x5e) [0x8ef9ce]
+Aborted
+
+
+/error
+Expected Results:
+The progress bar should be updated, and should disply th
+
+How often does this happen?
+This bug happens almost every time I run the bug with the code the line
+"Thread.Sleep(0);" in place. It still happens, but much less frequently
+when the line is remove
+
+Additional Information:
+The higher I set the thread value the less frequently this appears to
+happen. Sometimes the applicaiton needs to be run a few times before the
+error occurs. when the error does ocur the Application appears to ignore
+paint messages, and when moved behind another windows it turn to and ugly
+and incomplete grey.
+
+Also, I am sorry I cannot figure exactly where this bug is coming from, But
+I hope that this points you guys in the right direction.
More information about the mono-bugs
mailing list