Bug 16321 - cairo finalizers not called in the main loop causes freezes and crashes
Summary: cairo finalizers not called in the main loop causes freezes and crashes
Status: NEW
Alias: None
Product: Gtk#
Classification: Mono
Component: gtk-sharp ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-11-18 15:09 UTC by Andres G. Aragoneses
Modified: 2013-11-18 15:17 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 16321 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Andres G. Aragoneses 2013-11-18 15:09:39 UTC
The kind of crashes I was getting were related to X-Windows (BadMatch errors and the like).


I got this one now though:

(Nereid:12153): Gdk-WARNING **: losing last reference to undestroyed window


(Nereid:12153): GLib-GObject-WARNING **: g_object_remove_toggle_ref: couldn't find toggle ref 0x417c87e0(0x1e63)
Domain: 'Gtk' Level: Critical
Message: gtk_cairo_should_draw_window: assertion `GDK_IS_WINDOW (window)' failed
Trace follows:
   at GLib.Log.PrintTraceLogFunction(System.String domain, LogLevelFlags level, System.String message)
   at GLib.Log.NativeCallback(IntPtr log_domain_native, LogLevelFlags flags, IntPtr message_native, IntPtr user_data)
   at System.Object.wrapper_native_0x2b4469fa2460(IntPtr , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Banshee.Gui.GtkBaseClient.Run()
   at Banshee.Gui.GtkBaseClient.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at Banshee.Gui.GtkBaseClient.Startup()
   at Banshee.Gui.GtkBaseClient.Startup(System.String[] args)
   at Nereid.Client.Main(System.String[] args)


(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_get_effective_parent: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_invalidate_maybe_recurse_full: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_invalidate_maybe_recurse_full: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_invalidate_maybe_recurse_full: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_invalidate_maybe_recurse_full: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_invalidate_maybe_recurse_full: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_invalidate_maybe_recurse_full: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_is_visible: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_show_internal: assertion `GDK_IS_WINDOW (window)' failed

(Nereid:12153): Gdk-CRITICAL **: gdk_window_move_resize_internal: assertion `GDK_IS_WINDOW (window)' failed
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gdk.CairoHelper.gdk_cairo_create (intptr) <IL 0x00011, 0xffffffff>
  at Gdk.CairoHelper.Create (Gdk.Window) [0x00017] in /home/knocte/Documents/Code/gtk-sharpCLEAN/gdk/generated/CairoHelper.cs:16
  at Hyena.Data.Gui.ListView`1.get_PangoLayout () [0x00029] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs:51
  at Hyena.Gui.Canvas.TextBlock.EnsureLayout () [0x0000d] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs:52
  at Hyena.Gui.Canvas.TextBlock.Measure (Hyena.Gui.Canvas.Size) [0x00002] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs:59
  at Hyena.Gui.Canvas.StackPanel.Measure (Hyena.Gui.Canvas.Size) [0x00049] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/StackPanel.cs:50
  at Hyena.Data.Gui.DataViewLayoutGrid.InvalidateChildSize () [0x00037] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs:52
  at Hyena.Data.Gui.DataViewLayout.Allocate (Hyena.Gui.Canvas.Rect) [0x00009] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Data.Gui/DataViewLayout.cs:94
  at Hyena.Data.Gui.ListView`1.OnSizeAllocated (Gdk.Rectangle) [0x00097] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Windowing.cs:188
  at Gtk.Widget.SizeAllocated_cb (intptr,intptr) [0x00025] in /home/knocte/Documents/Code/gtk-sharpCLEAN/gtk/generated/Widget.cs:1821
  at (wrapper native-to-managed) Gtk.Widget.SizeAllocated_cb (intptr,intptr) <IL 0x00022, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) object.wrapper_native_0x2b4469fa1c10 (intptr,intptr) <IL 0x00024, 0xffffffff>
  at (wrapper native-to-managed) object.wrapper_native_0x2b4469fa1c10 (intptr,intptr) <IL 0x00022, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x0000e, 0xffffffff>
  at Gtk.Application.Run () [0x00001] in /home/knocte/Documents/Code/gtk-sharpCLEAN/gtk/Application.cs:133
  at Banshee.Gui.GtkBaseClient.Run () [0x00019] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:225
  at Banshee.Gui.GtkBaseClient.Startup () [0x00010] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:79
  at Hyena.Gui.CleanRoomStartup.Startup (Hyena.Gui.CleanRoomStartup/StartupInvocationHandler) [0x00050] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:54
  at Banshee.Gui.GtkBaseClient.Startup<T> () [0x00049] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:74
  at Banshee.Gui.GtkBaseClient.Startup<T> (string[]) [0x00021] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:64
  at Nereid.Client.Main (string[]) [0x00002] in /home/knocte/Documents/Code/bansheeGSTS1/src/Clients/Nereid/Nereid/Client.cs:54
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

Native stacktrace:

	/usr/bin/mono() [0x4a9b01]
	/usr/bin/mono() [0x50058f]
	/usr/bin/mono() [0x41f477]
	/lib/x86_64-linux-gnu/libpthread.so.0(+0xfbd0) [0x2b44603b0bd0]
	/usr/lib/x86_64-linux-gnu/libcairo.so.2(cairo_surface_create_for_rectangle+0x44) [0x2b446b1e6b94]
	/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x2f0c1) [0x2b446a3b30c1]
	/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(gdk_cairo_create+0x78) [0x2b446a3b3188]
	[0x402a53ee]

Debug info from gdb:

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No threads.

=================================================================
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.
=================================================================

/bin/bash: line 1: 12153 Aborted                 (core dumped) /usr/bin/mono --debug --profile=gui-thread-check Nereid.exe --debug --uninstalled
make: *** [run] Error 134
Comment 1 Andres G. Aragoneses 2013-11-18 15:17:07 UTC
It's probing very hard to reproduce the crashes and the freezes now, but I just realised it may be because of this two recent fixes:

https://github.com/mono/gtk-sharp/commit/e48ac63d54c4c245f25b73c548f90b649acea2c8

https://github.com/mono/gtk-sharp/commit/51f102bc34de812843d37b3eab3b556583550b50

So I reverted them, used banshee, and could reproduce a freeze, so this is the output from kill XYZ -s QUIT:


"<threadpool thread>" tid=0x0x2abc05048700 this=0x0x2abc04f0de50 thread handle 0x601 state : interrupted state owns ()


"IO Threadpool worker" tid=0x0x2abc065fc700 this=0x0x2abc04f0dfb0 thread handle 0x603 state : interrupted state owns ()


"Threadpool monitor" tid=0x0x2abc13383700 this=0x0x2abbefac94b0 thread handle 0x45a state : interrupted state owns ()


"Threadpool worker" tid=0x0x2abc1f115700 this=0x0x2abc04f0c850 thread handle 0x51b state : interrupted state owns ()


"<unnamed thread>" tid=0x0x2abc1f93b700 this=0x0x2abc1daeaed0 thread handle 0x642 state : interrupted state owns ()


"<unnamed thread>" tid=0x0x2abc1fb4c700 this=0x0x2abc04074590 thread handle 0x671 state : interrupted state owns ()


"<unnamed thread>" tid=0x0x2abc1fdba700 this=0x0x2abc4c0f3c90 thread handle 0x66c state : interrupted state owns ()


"<unnamed thread>" tid=0x0x2abc1f73a700 this=0x0x2abc1daeb030 thread handle 0x643 state : interrupted state owns ()


"Threadpool worker" tid=0x0x2abc13ff5700 this=0x0x2abc13b1a270 thread handle 0x6ce state : interrupted state owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Threading.WaitHandle.WaitAny_internal (System.Threading.WaitHandle[],int,bool) <IL 0x0000f, 0xffffffff>
  at System.Threading.WaitHandle.WaitAny (System.Threading.WaitHandle[],System.TimeSpan,bool) <IL 0x0003e, 0x0008b>
  at System.Threading.RegisteredWaitHandle.Wait (object) <IL 0x00021, 0x000eb>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>


"<unnamed thread>" tid=0x0x2abc09cbf700 this=0x0x2abc4c0f02d0 thread handle 0x6c9 state : interrupted state owns ()


"HyenaSqliteConnection (/home/knocte/.config/banshee-1/banshee.db)" tid=0x0x2abbeff00700 this=0x0x2abbdbf6b5b0 thread handle 0x420 state : interrupted state owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Threading.WaitHandle.WaitOne_internal (System.Threading.WaitHandle,intptr,int,bool) <IL 0x0001c, 0xffffffff>
  at System.Threading.WaitHandle.WaitOne () <IL 0x00023, 0x0007f>
  at Hyena.Data.Sqlite.HyenaSqliteConnection.ProcessQueue () [0x00133] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteConnection.cs:454
  at System.Threading.Thread.StartInternal () <IL 0x00021, 0x00080>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0004e, 0xffffffff>


"Threadpool worker" tid=0x0x2abc1da88700 this=0x0x2abc13b1a3d0 thread handle 0x6e0 state : interrupted state owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Threading.WaitHandle.WaitAny_internal (System.Threading.WaitHandle[],int,bool) <IL 0x0000f, 0xffffffff>
  at System.Threading.WaitHandle.WaitAny (System.Threading.WaitHandle[],System.TimeSpan,bool) <IL 0x0003e, 0x0008b>
  at System.Threading.RegisteredWaitHandle.Wait (object) <IL 0x00021, 0x000eb>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>


"Threadpool worker" tid=0x0x2abc1c451700 this=0x0x2abc1dae8b10 thread handle 0x4db state : interrupted state owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Threading.WaitHandle.WaitAny_internal (System.Threading.WaitHandle[],int,bool) <IL 0x0000f, 0xffffffff>
  at System.Threading.WaitHandle.WaitAny (System.Threading.WaitHandle[],System.TimeSpan,bool) <IL 0x0003e, 0x0008b>
  at System.Threading.RegisteredWaitHandle.Wait (object) <IL 0x00021, 0x000eb>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>


"Threadpool worker" tid=0x0x2abc1dd18700 this=0x0x2abc1dae8850 thread handle 0x6f0 state : interrupted state owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Mono.Unix.Native.Syscall.read (int,intptr,ulong) <IL 0x00019, 0xffffffff>
  at Mono.Unix.Native.Syscall.read (int,void*,ulong) <IL 0x00008, 0x00043>
  at Mono.Unix.UnixStream.Read (byte[],int,int) <IL 0x00042, 0x0009b>
  at NDesk.DBus.Connection.ReadMessage () <IL 0x00014, 0x00066>
  at NDesk.DBus.Connection.Iterate () <IL 0x0000c, 0x0006b>
  at Mono.Zeroconf.Providers.AvahiDBus.DBusManager.IterateThread (object) <IL 0x00033, 0x000b3>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>


"Main Thread" tid=0x0x2abbdbe79500 this=0x0x2abbdbf68010 thread handle 0x403 state : not waiting owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x0000e, 0xffffffff>
  at Gtk.Application.Run () [0x00001] in /home/knocte/Documents/Code/gtk-sharpCLEAN/gtk/Application.cs:133
  at Banshee.Gui.GtkBaseClient.Run () [0x00019] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:225
  at Banshee.Gui.GtkBaseClient.Startup () [0x00010] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:79
  at Hyena.Gui.CleanRoomStartup.Startup (Hyena.Gui.CleanRoomStartup/StartupInvocationHandler) [0x00050] in /home/knocte/Documents/Code/bansheeGSTS1/src/Hyena/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:54
  at Banshee.Gui.GtkBaseClient.Startup<T> () [0x00049] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:74
  at Banshee.Gui.GtkBaseClient.Startup<T> (string[]) [0x00021] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:64
  at Nereid.Client.Main (string[]) [0x00002] in /home/knocte/Documents/Code/bansheeGSTS1/src/Clients/Nereid/Nereid/Client.cs:54
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>


"Threadpool worker" tid=0x0x2abc13584700 this=0x0x2abbefac9610 thread handle 0x45b state : interrupted state owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Threading.WaitHandle.WaitAny_internal (System.Threading.WaitHandle[],int,bool) <IL 0x0000f, 0xffffffff>
  at System.Threading.WaitHandle.WaitAny (System.Threading.WaitHandle[],System.TimeSpan,bool) <IL 0x0003e, 0x0008b>
  at System.Threading.RegisteredWaitHandle.Wait (object) <IL 0x00021, 0x000eb>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>


"DAAP Proxy" tid=0x0x2abc1df1d700 this=0x0x2abc1dae89b0 thread handle 0x419 state : interrupted state owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Net.Sockets.Socket.Accept_internal (intptr,int&,bool) <IL 0x0000f, 0xffffffff>
  at System.Net.Sockets.Socket.Accept () <IL 0x00044, 0x0008f>
  at Banshee.Web.BaseHttpServer.ServerLoop () [0x00091] in /home/knocte/Documents/Code/bansheeGSTS1/src/Core/Banshee.Services/Banshee.Web/BaseHttpServer.cs:161
  at System.Threading.Thread.StartInternal () <IL 0x00021, 0x00080>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0004e, 0xffffffff>

Cairo.Context is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Context is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces