Bug 13078 - Hard crash in icon rendering
Summary: Hard crash in icon rendering
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: master
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-07-06 11:51 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-07-11 14:07 UTC (History)
2 users (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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mikayla Hutchinson [MSFT] 2013-07-06 11:51:51 UTC
This has happened to me a few times with master MD + bockbuild. Probably something in the new retina icon code.

GLib-GObject:ERROR:gobject.c:2732:toggle_refs_notify: assertion failed: (tstack.n_toggle_refs == 1)
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.IconSet.gtk_icon_set_render_icon (intptr,intptr,int,int,int,intptr,intptr) <IL 0x0002e, 0xffffffff>
  at Gtk.IconSet.RenderIcon (Gtk.Style,Gtk.TextDirection,Gtk.StateType,Gtk.IconSize,Gtk.Widget,string) [0x00009] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/generated/IconSet.cs:45
  at MonoDevelop.Ide.ImageService.GetPixbuf (string,Gtk.IconSize,bool) [0x000bf] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:309
  at MonoDevelop.Ide.ImageService.GetPixbuf (string,Gtk.IconSize) [0x00001] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:282
  at MonoDevelop.Debugger.ObjectValueTreeView..ctor () [0x0018c] in /Users/michael/Mono/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:141
  at MonoDevelop.SourceEditor.DebugValueWindow..ctor (Mono.TextEditor.TextEditor,int,Mono.Debugging.Client.StackFrame,Mono.Debugging.Client.ObjectValue,MonoDevelop.Debugger.PinnedWatch) [0x0005f] in /Users/michael/Mono/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs:90
  at MonoDevelop.SourceEditor.DebugValueTooltipProvider.ShowTooltipWindow (Mono.TextEditor.TextEditor,int,Gdk.ModifierType,int,int,Mono.TextEditor.TooltipItem) [0x00052] in /Users/michael/Mono/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs:305
  at Mono.TextEditor.TextArea.TooltipTimer () [0x00154] in /Users/michael/Mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs:2729
  at GLib.Timeout/TimeoutProxy.Handler () [0x0000e] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/glib/Timeout.cs:70
  at (wrapper native-to-managed) GLib.Timeout/TimeoutProxy.Handler () <IL 0x0002d, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x00022, 0xffffffff>
  at Gtk.Application.Run () [0x00001] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:135
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:397
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) [0x0075d] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:286
  at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00083] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:533
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:17
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>

Native stacktrace:

	0   mono-sgen                           0x001232b4 mono_handle_native_sigsegv + 292
	1   mono-sgen                           0x00178a7d sigabrt_signal_handler + 109
	2   libsystem_c.dylib                   0x90b4c8cb _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libsystem_c.dylib                   0x90b984ec abort + 168
	5   libglib-2.0.0.dylib                 0x027b661b g_assertion_message + 555
	6   libglib-2.0.0.dylib                 0x027b66ec g_assertion_message_expr + 124
	7   libgobject-2.0.0.dylib              0x03a5c080 toggle_refs_notify + 176
	8   libgobject-2.0.0.dylib              0x03a5c7e1 g_object_unref + 353
	9   libgtk-quartz-2.0.0.dylib           0x029f7d0a cached_icon_free + 26
	10  libgtk-quartz-2.0.0.dylib           0x029f8096 add_to_cache + 550
	11  libgtk-quartz-2.0.0.dylib           0x029f6422 gtk_icon_set_render_icon_internal + 530
	12  libgtk-quartz-2.0.0.dylib           0x029f6637 gtk_icon_set_render_icon + 503
	13  ???                                 0x0a13ee00 0x0 + 169078272
	14  ???                                 0x0a13ed5c 0x0 + 169078108
	15  ???                                 0x0a13e580 0x0 + 169076096
	16  ???                                 0x0a13e338 0x0 + 169075512
	17  ???                                 0x15f65ddc 0x0 + 368467420
	18  ???                                 0x17d97df0 0x0 + 400129520
	19  ???                                 0x17d97bf4 0x0 + 400129012
	20  ???                                 0x149dbc61 0x0 + 345881697
	21  ???                                 0x0e16522e 0x0 + 236343854
	22  ???                                 0x0bd82020 0x0 + 198713376
	23  libglib-2.0.0.dylib                 0x02785ab6 g_timeout_dispatch + 102
	24  libglib-2.0.0.dylib                 0x02783969 g_main_dispatch + 409
	25  libglib-2.0.0.dylib                 0x02784730 g_main_context_dispatch + 48
	26  libglib-2.0.0.dylib                 0x02784938 g_main_context_iterate + 504
	27  libglib-2.0.0.dylib                 0x02784e6f g_main_loop_run + 527
	28  libgtk-quartz-2.0.0.dylib           0x02a410b0 gtk_main + 240
	29  ???                                 0x0e1263a8 0x0 + 236086184
	30  ???                                 0x0e126304 0x0 + 236086020
	31  ???                                 0x0e1262e4 0x0 + 236085988
	32  ???                                 0x022544b8 0x0 + 35996856
	33  ???                                 0x00687064 0x0 + 6844516
	34  ???                                 0x00686dfc 0x0 + 6843900
	35  ???                                 0x00686ec2 0x0 + 6844098
	36  mono-sgen                           0x000893e5 mono_jit_runtime_invoke + 741
	37  mono-sgen                           0x0023f72e mono_runtime_invoke + 126
	38  mono-sgen                           0x00243ca4 mono_runtime_exec_main + 420
	39  mono-sgen                           0x00244015 mono_runtime_run_main + 725
	40  mono-sgen                           0x000f3e65 mono_jit_exec + 149
	41  mono-sgen                           0x000f6259 mono_main + 9193
	42  mono-sgen                           0x0007cb59 main + 553
	43  libdyld.dylib                       0x94e34725 start + 0
Comment 1 Mikayla Hutchinson [MSFT] 2013-07-10 22:00:42 UTC
This can be reproduced by right-clicking on a project in the solution tree, then double-clicking on it.

The right-click causes an error when MD renders composed icons, not sure whether this is related.

ERROR [2013-07-10 20:26:59Z]: GdkPixbuf-Critical: gdk_pixbuf_composite: assertion `dest_x >= 0 && dest_x + dest_width <= dest->width' failed
Stack trace: 
   at Gdk.Pixbuf.gdk_pixbuf_composite(IntPtr , IntPtr , Int32 , Int32 , Int32 , Int32 , Double , Double , Double , Double , Int32 , Int32 )
   at Gdk.Pixbuf.Composite(Gdk.Pixbuf dest, Int32 dest_x, Int32 dest_y, Int32 dest_width, Int32 dest_height, Double offset_x, Double offset_y, Double scale_x, Double scale_y, InterpType interp_type, Int32 overall_alpha) in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gdk/generated/Pixbuf.cs:line 283
   at MonoDevelop.Ide.ImageService.MergeIcons(Gdk.Pixbuf icon1, Gdk.Pixbuf icon2) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 196
   at MonoDevelop.Ide.ImageService.MergeIcons(Gdk.Pixbuf icon1, Gdk.Pixbuf icon2) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 206
   at MonoDevelop.Ide.ImageService.GetComposedIcon(System.String[] ids, IconSize size) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 659
   at MonoDevelop.Ide.ImageService.GetStockIdForImageSpec(Mono.Addins.RuntimeAddin addin, System.String filename, IconSize size) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 682
   at MonoDevelop.Ide.ImageService.LoadStockIcon(MonoDevelop.Ide.Extensions.StockIconCodon iconCodon, Boolean forceWildcard) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 137
   at MonoDevelop.Ide.ImageService.EnsureStockIconIsLoaded(System.String stockId, IconSize size) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 367
   at MonoDevelop.Ide.ImageService.<ImageService>m__13F(System.String stockId) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 67
   at MonoDevelop.Core.IconId.get_Name() in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IconId.cs:line 54
   at MonoDevelop.Core.IconId.op_Implicit(IconId icon) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IconId.cs:line 66
   at MonoDevelop.Components.Commands.CommandMenuItem.Update(MonoDevelop.Components.Commands.CommandInfo cmdInfo) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs:line 228
   at MonoDevelop.Components.Commands.CommandMenuItem.MonoDevelop.Components.Commands.ICommandUserItem.Update(MonoDevelop.Components.Commands.CommandTargetRoute targetRoute) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs:line 70
   at MonoDevelop.Components.Commands.CommandMenuItem.OnParentSet(Gtk.Widget parent) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs:line 102
   at Gtk.Widget.parentset_cb(IntPtr widget, IntPtr previous_parent) in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/generated/Widget.cs:line 3319
   at Gtk.MenuShell.gtk_menu_shell_append(IntPtr , IntPtr )
   at Gtk.MenuShell.Append(Gtk.Widget child) in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/generated/MenuShell.cs:line 365
   at MonoDevelop.Components.Commands.CommandManager.CreateMenu(MonoDevelop.Components.Commands.CommandEntrySet entrySet, MonoDevelop.Components.Commands.CommandMenu menu) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 665
   at MonoDevelop.Components.Commands.CommandManager.CreateMenu(MonoDevelop.Components.Commands.CommandEntrySet entrySet, System.Object initialTarget) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 698
   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.CreateContextMenu() in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:line 1802
   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.ShowPopup(Gdk.EventButton evt) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:line 1767
   at MonoDevelop.Components.ContextMenuTreeView.OnButtonPressEvent(Gdk.EventButton evnt) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs:line 62
   at Gtk.Widget.buttonpressevent_cb(IntPtr widget, IntPtr evnt) in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/generated/Widget.cs:line 2938
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run() in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:line 135
   at MonoDevelop.Ide.IdeApp.Run() in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:line 397
   at MonoDevelop.Ide.IdeStartup.Run(MonoDevelop.Ide.MonoDevelopOptions options) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 286
   at MonoDevelop.Ide.IdeStartup.Main(System.String[] args) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 533
   at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args) in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:line 17

Then the hard crash happens immediately afterwards.

tstack.n_toggle_refs is somehow 2.

This only happens with the retina icon patches.
Comment 2 Mikayla Hutchinson [MSFT] 2013-07-10 22:03:40 UTC
This may be caused by our new icon loader code:
https://github.com/mono/monodevelop/commit/0fcff1439ea98a5bd2725e32f16ceb5056898eda
Comment 3 Mikayla Hutchinson [MSFT] 2013-07-10 22:56:37 UTC
Fixed the crash in https://github.com/mono/monodevelop/commit/b68ad2d787be0e47451d7c2ff4de14eaa7dc5b73
Comment 4 Mikayla Hutchinson [MSFT] 2013-07-11 00:45:26 UTC
I debugged the gdk-criticals and it seems to be a bug in the GTK+ patches. I've opened a new bug, https://bugzilla.xamarin.com/show_bug.cgi?id=13165, containing my findings.
Comment 5 Lluis Sanchez 2013-07-11 12:20:44 UTC
Bug 13165 is fixed. I guess this one can be closed too?
Comment 6 Mikayla Hutchinson [MSFT] 2013-07-11 14:07:49 UTC
Ported into XWT too, BTW. Was kinda painful because XWT has an outdated, modified copy of GtkWorkarounds.