Bug 29774 - <Error>: CGContextRestoreGState: invalid context 0x0.
Summary: <Error>: CGContextRestoreGState: invalid context 0x0.
Status: RESOLVED NORESPONSE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 5.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Cody Russell
URL:
Depends on:
Blocks:
 
Reported: 2015-05-05 17:54 UTC by Marek Safar
Modified: 2017-07-19 20:16 UTC (History)
3 users (show)

Tags: gtk
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 NORESPONSE

Description Marek Safar 2015-05-05 17:54:54 UTC
<Error>: CGContextRestoreGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Assertion failed: (! surface->finished), function _cairo_surface_begin_modification, file cairo-surface.c, line 394.
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Cairo.NativeMethods.cairo_stroke (intptr) <IL 0x0002b, 0xffffffff>
  at Cairo.Context.Stroke () [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs:513
  at MonoDevelop.Components.PopoverWindowTheme.RenderBorder (Cairo.Context,Gdk.Rectangle,MonoDevelop.Components.PopupPosition) [0x00017] in /Users/builder/data/lanes/432/192627c3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindowTheme.cs:296
  at MonoDevelop.Components.PopoverWindow.OnExposeEvent (Gdk.EventExpose) [0x00169] in /Users/builder/data/lanes/432/192627c3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs:387
  at Gtk.Widget.exposeevent_cb (intptr,intptr) [0x00016] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/gtk/generated/Widget.cs:1113
  at (wrapper native-to-managed) Gtk.Widget.exposeevent_cb (intptr,intptr) <IL 0x0002c, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x0002a, 0xffffffff>
  at Gtk.Application.Run () [0x00001] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/gtk/Application.cs:135
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /Users/builder/data/lanes/432/192627c3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:374
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) [0x007f1] in /Users/builder/data/lanes/432/192627c3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:288
  at MonoDevelop.Ide.IdeStartup.Main (string[],MonoDevelop.Ide.Extensions.IdeCustomizer) [0x00093] in /Users/builder/data/lanes/432/192627c3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:649
  at Xamarin.Startup.MainClass.Main (string[]) [0x00003] in /Users/builder/data/lanes/432/192627c3/source/md-addins/Xamarin.Startup/Main.cs:11
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0006c, 0xffffffff>

Native stacktrace:

	0   libmonosgen-2.0.dylib               0x00244a06 mono_handle_native_sigsegv + 342
	1   libmonosgen-2.0.dylib               0x00294f81 sigabrt_signal_handler + 129
	2   libsystem_platform.dylib            0x9511503b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libsystem_c.dylib                   0x96d36eee abort + 156
	5   libsystem_c.dylib                   0x96cff8c5 basename + 0
	6   libcairo.2.dylib                    0x03841e66 _cairo_surface_begin_modification + 214
	7   libcairo.2.dylib                    0x038459ff _cairo_surface_stroke + 255
	8   libcairo.2.dylib                    0x037d9652 _cairo_gstate_stroke + 674
	9   libcairo.2.dylib                    0x037d1b7d _cairo_default_context_stroke + 45
	10  libcairo.2.dylib                    0x037c3bc5 cairo_stroke + 53
	11  ???                                 0x157c9cfc 0x0 + 360488188
	12  ???                                 0x157c9cac 0x0 + 360488108
	13  ???                                 0x172ebedc 0x0 + 388939484
	14  ???                                 0x172eb2a6 0x0 + 388936358
	15  ???                                 0x123ea78d 0x0 + 306096013
	16  ???                                 0x0f1ff28c 0x0 + 253751948
	17  libgtk-quartz-2.0.0.dylib           0x0317a0e8 _gtk_marshal_BOOLEAN__BOXED + 360
	18  libgobject-2.0.0.dylib              0x040a9d23 g_type_class_meta_marshal + 147
	19  libgobject-2.0.0.dylib              0x040a9170 g_closure_invoke + 560
	20  libgobject-2.0.0.dylib              0x040ce990 signal_emit_unlocked_R + 2448
	21  libgobject-2.0.0.dylib              0x040d0219 g_signal_emit_valist + 5033
	22  libgobject-2.0.0.dylib              0x040d087b g_signal_emit + 59
	23  libgtk-quartz-2.0.0.dylib           0x0339f163 gtk_widget_event_internal + 835
	24  libgtk-quartz-2.0.0.dylib           0x0339f8ca gtk_widget_send_expose + 474
	25  libgtk-quartz-2.0.0.dylib           0x031745df gtk_main_do_event + 735
	26  libgdk-quartz-2.0.0.dylib           0x03674678 _gdk_window_process_updates_recurse + 872
	27  libgdk-quartz-2.0.0.dylib           0x0368c2b5 -[GdkQuartzView drawRect:] + 709
	28  AppKit                              0x95d53607 -[NSView _drawRect:clip:] + 4221
	29  AppKit                              0x95d51e32 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2071
	30  AppKit                              0x95d52189 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2926
	31  AppKit                              0x95d4fdea -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 876
	32  AppKit                              0x95e6c2e0 -[NSNextStepFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 277
	33  AppKit                              0x95d4c338 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2942
	34  AppKit                              0x95d29867 -[NSView displayIfNeeded] + 1629
	35  AppKit                              0x95e61a26 -[NSNextStepFrame displayIfNeeded] + 48
	36  AppKit                              0x95d14bf3 -[NSWindow _setFrameCommon:display:stashSize:] + 3709
	37  AppKit                              0x95d13d5f -[NSWindow _setFrame:display:allowImplicitAnimation:stashSize:] + 310
	38  AppKit                              0x95d13c19 -[NSWindow setFrame:display:] + 79
	39  libgdk-quartz-2.0.0.dylib           0x036b0ed1 move_resize_window_internal + 1249
	40  libgdk-quartz-2.0.0.dylib           0x036b3cf9 window_quartz_resize + 329
	41  libgdk-quartz-2.0.0.dylib           0x036b2984 gdk_window_quartz_move_resize + 196
	42  libgdk-quartz-2.0.0.dylib           0x03682418 gdk_window_move_resize_toplevel + 296
	43  libgdk-quartz-2.0.0.dylib           0x03678c99 gdk_window_move_resize_internal + 345
	44  libgdk-quartz-2.0.0.dylib           0x036792b2 gdk_window_resize + 82
	45  libgtk-quartz-2.0.0.dylib           0x033c7bfd gtk_window_move_resize + 1389
	46  libgtk-quartz-2.0.0.dylib           0x033c6dcb gtk_window_check_resize + 91
	47  libgobject-2.0.0.dylib              0x040ad525 g_cclosure_marshal_VOID__VOIDv + 181
	48  libgobject-2.0.0.dylib              0x040aa1f0 g_type_class_meta_marshalv + 176
	49  libgobject-2.0.0.dylib              0x040a9564 _g_closure_invoke_va + 596
	50  libgobject-2.0.0.dylib              0x040cf61e g_signal_emit_valist + 1966
	51  libgobject-2.0.0.dylib              0x040d087b g_signal_emit + 59
	52  libgtk-quartz-2.0.0.dylib           0x0307fff1 gtk_container_check_resize + 241
	53  libgtk-quartz-2.0.0.dylib           0x0307fee0 gtk_container_idle_sizer + 160
	54  libgdk-quartz-2.0.0.dylib           0x03638f0f gdk_threads_dispatch + 111
	55  libglib-2.0.0.dylib                 0x02e97421 g_idle_dispatch + 113
	56  libglib-2.0.0.dylib                 0x02e9bf23 g_main_dispatch + 467
	57  libglib-2.0.0.dylib                 0x02e9bd35 g_main_context_dispatch + 53
	58  libglib-2.0.0.dylib                 0x02e9c3eb g_main_context_iterate + 539
	59  libglib-2.0.0.dylib                 0x02e9c9ba g_main_loop_run + 682
	60  libgtk-quartz-2.0.0.dylib           0x03173d4f gtk_main + 287
	61  ???                                 0x13cc9444 0x0 + 332174404
	62  ???                                 0x13cc93fc 0x0 + 332174332
	63  ???                                 0x13cc93dc 0x0 + 332174300
	64  ???                                 0x028630f4 0x0 + 42348788
	65  ???                                 0x0075a170 0x0 + 7709040
	66  ???                                 0x00759f0c 0x0 + 7708428
	67  ???                                 0x00759fe7 0x0 + 7708647
	68  libmonosgen-2.0.dylib               0x0019400f mono_jit_runtime_invoke + 751
	69  libmonosgen-2.0.dylib               0x0035622f mono_runtime_invoke + 127
	70  libmonosgen-2.0.dylib               0x0035c2b1 mono_runtime_exec_main + 401
	71  libmonosgen-2.0.dylib               0x0035c054 mono_runtime_run_main + 660
	72  libmonosgen-2.0.dylib               0x0020e9ad mono_jit_exec + 93
	73  libmonosgen-2.0.dylib               0x00210c80 mono_main + 7904
	74  XamarinStudio                       0x000dd8bb main + 2411
	75  libdyld.dylib                       0x973856d9 start + 1

Debug info from gdb:

(lldb) command source -s 1 '/tmp/mono-gdb-commands.DQfeI8'
warning: (i386) /Library/Frameworks/Mono.framework/Versions/Current/lib/libglib-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libintl.8.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libgtk-quartz-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libgdk-quartz-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libpangocairo-1.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libpango-1.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libgthread-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libatk-1.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libcairo.2.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libpixman-1.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libfontconfig.1.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libexpat.1.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libfreetype.6.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libgdk_pixbuf-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libpng14.14.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libgio-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libgmodule-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libgobject-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libffi.6.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/gtk-2.0/2.10.0/engines/libxamarin.so empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/gtk-2.0/2.10.0/engines/libquartz.so empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/pango/1.8.0/modules/pango-basic-coretext.so empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/gtk-2.0/2.10.0/immodules/im-quartz.so empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so empty dSYM file detected, dSYM was created with an executable with no debug info.
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/libjpeg.8.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Tajinder Singh 2015-05-06 02:59:33 UTC
I have try to checked this issue and unable to reproduce by given the description. I have no more information to reproduce this issue.

Can you please provide steps to reproduce.
Comment 2 Marek Safar 2015-05-06 03:06:51 UTC
There are no simple steps to reproduce it but check the stack trace it shows what is wrong.
Comment 3 Tom Opgenorth 2017-07-19 20:16:44 UTC
Because we have not received a reply to our request for more information, we are marking this issue as RESOLVED→NORESPONSE. If you are still encountering this issue on the latest Visual Studio 2017 for Mac Preview version 7.1, please don’t hesitate to reopen the ticket with the requested information. Thanks!