locked
Fix for GdipCreateFromContext_macosx and other *_macios GDI issues RRS feed

  • Question

  • User35201 posted

    Try installing this mono 3.10 version and forcing a rebuild of your application.

    https://www.dropbox.com/s/wrjnv7p8zj1rh5u/MonoFramework-MDK-3.10.0.26.macos10.xamarin.x86.pkg?dl=0

    One of the developers on the mono team worked hard to track down and fix this issue. Hopefully, this should be the end of the GDI issues for Xamarin.Mac users.

    Thanks, -- Chris H

    Thursday, October 30, 2014 4:39 AM

All replies

  • User82172 posted

    Awesome! Thank you!

    It didn't seem to work the first time so I did an uninstall/reinstall and now it's working perfect.

    Thanks again for all the hard work! :)

    Thursday, October 30, 2014 4:52 PM
  • User87179 posted

    Wow. I'm glad you fixed it, but don't you think this is a rather serious bug? I mean jeez! If I go to http://www.mono-project.com/download/ I would expect it to tell me the "Latest known good" release. But it does not even work with Hello World in the tutorial?!? What kind of quality control is that? May I suggest that before posting a new release of Mono they should at least TRY IT using a few of the tutorials. Also, stop telling people to use 3.10.0 if you know it is broken! It would help with credibility.

    Saturday, November 15, 2014 3:36 PM
  • User35201 posted

    Yes, I agree it was a serious bug and shouldn't have gotten through.

    It was caused by packaging changes and we didn't find it until the last minute. We've made changes so that bugs like it don't slip through in the future.

    Saturday, November 15, 2014 4:37 PM
  • User87179 posted

    works great now, thanks!

    Monday, November 17, 2014 1:15 AM
  • User3695 posted

    Looks like this is still a problem with the official release. How long can stuff like this stay broken?

    Monday, December 8, 2014 8:51 PM
  • User35201 posted

    @Jaykul? It is not known to be broken in our stable release at the moment. Can you post the following:

    • mono --version (and where you got it, XS updater, mono website)
    • Xamarin.Mac Version
    • Error
    • Test Case (if available).
    Monday, December 8, 2014 9:09 PM
  • User92629 posted

    I still get this with the winforms hello world example using mono 3.10.0 on OSX 10.10.1

    macbook-2:~ bob$ mono --version Mono JIT compiler version 3.10.0 ((detached/47db868 Thu Oct 2 22:04:39 EDT 2014) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: normal SIGSEGV: altstack Notification: kqueue Architecture: x86 Disabled: none Misc: softdebug LLVM: yes(3.4svn-mono-(detached/e656cac) GC: sgen

    macbook-2:~ bob$ vi hello.cs macbook-2:~ bob$ mcs hello.cs -pkg:dotnet macbook-2:~ bob$ mono hello.exe System.EntryPointNotFoundException: GdipCreateFromContextmacosx at (wrapper managed-to-native) System.Drawing.GDIPlus:GdipCreateFromContextmacosx (intptr,int,int,intptr&) at System.Drawing.Graphics.FromHwnd (IntPtr hwnd) [0x00000] in :0 at System.Windows.Forms.XplatUICarbon.PaintEventStart (System.Windows.Forms.Message& msg, IntPtr handle, Boolean client) [0x00000] in :0 at System.Windows.Forms.XplatUI.PaintEventStart (System.Windows.Forms.Message& msg, IntPtr handle, Boolean client) [0x00000] in :0 at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in :0

    Tuesday, December 9, 2014 6:33 AM
  • User35201 posted

    I just spoke to the runtime team lead. The version of 3.10 with the fix is:

    Mono JIT compiler version 3.10.0 ((detached/92c4884 Thu Nov 13 23:27:38 EST 2014)

    We did an update on 3.10.0 to fix this issue. Everyone who has run into this issue, please download the newest release version either from the mono website or via the Xamarin Studio updater, and let me know if you somehow still don't get this (fixed) version.

    Tuesday, December 9, 2014 4:07 PM
  • User92629 posted

    TLDR: I have the latest release from mono-project.com and xamarin says I'm up to date, but this problem persists (System.EntryPointNotFoundException: GdipCreateFromContext_macosx ).

    I'm trying to build now from the latest source tarball but it does seem that the version you listed (detached/92c4884 Thu Nov 13 23:27:38 EST 2014) is released.

    Detail: I downloaded the latest MRE from http://www.mono-project.com/download/ (direct link http://download.mono-project.com/archive/3.10.0/macos-10-x86/MonoFramework-MRE-3.10.0.macos10.xamarin.x86.pkg) It has md5 checksum: 58f55125813b4a94f3fae6b44a7e7163

    The mono version installed by this package reports the following version:

    /Library/Frameworks/Mono.framework/Versions/3.10.0/bin/mono --version Mono JIT compiler version 3.10.0 ((detached/47db868 Thu Oct 2 22:04:39 EDT 2014) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: normal SIGSEGV: altstack Notification: kqueue Architecture: x86 Disabled: none Misc: softdebug LLVM: yes(3.4svn-mono-(detached/e656cac) GC: sgen

    Xamarin Studio says no updates are available, and lists this version info: Xamarin Studio Version 5.5.4 (build 15) Installation UUID: 22853b80-34ca-4e69-be2f-324a0b32a93a Runtime: Mono 3.10.0 ((detached/47db868) GTK+ 2.24.23 (Raleigh theme)

    Package version: 310000019
    

    Apple Developer Tools Xcode 6.1.1 (6611) Build 6A2008a

    Xamarin.iOS Not Installed

    Xamarin.Android Not Installed

    Xamarin.Mac Version:

    Build Information Release ID: 505040015 Git revision: f93940a35458a18052f1a25e106e62ca970d9c40 Build date: 2014-11-19 15:32:41-05 Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

    Operating System Mac OS X 10.10.1 Darwin macbook-2.local 14.0.0 Darwin Kernel Version 14.0.0 Fri Sep 19 00:26:44 PDT 2014 root:xnu-2782.1.97~2/RELEASEX8664 x86_64

    Tuesday, December 9, 2014 11:28 PM
  • User92629 posted

    oops typo... I meant to say that it does not seem like the version you mentioned has been released. The 3.10.0 MRE package on mono-project.com is older ((detached/47db868 Thu Oct 2 22:04:39 EDT 2014)

    Wednesday, December 10, 2014 2:47 AM
  • User35201 posted

    @scruffycatherder? I spoke to the a guy on the runtime team and it has been suggested you either:

    a) Install XS and use the Xamarin Updater to get the latest mono from that (one one we generally support best). b) OR install the pkg I have linked above.

    -- Chris H

    Wednesday, December 10, 2014 3:54 PM
  • User35201 posted

    Also, as a side note, here's a more official build link:

    http://storage.bos.internalx.com/mono-mac-3.10.0-branch/92/92c48842a3ff0791d996b6577265ce453ff87670/MonoFramework-MDK-3.10.0.31.macos10.xamarin.x86.pkg

    We're working to update the build on the mono website to match, but in general we expect most people to be using the mono installed with Xamarin Studio when they build Xamarin.Mac applications.

    Wednesday, December 10, 2014 4:30 PM
  • User92629 posted

    @chamons Thanks for putting the package on a domain owned by Xamarin. I was not inclined to install a package downloaded from dropbox :)

    FWIW, I do have XS and the XS updater states that everything is up to date in both stable and beta channels. I included the XS version details in a previous post. My XS install includes the same version of mono 3.10.0 that is currently listed on mono-project.com. Perhaps there is an additional bug in the XS Updater?

    Thanks!

    Thursday, December 11, 2014 3:24 AM
  • User94672 posted

    hi chamon, is it possible to download the MRE version of MDK-3.10.0.26.macos10.xamarin.x86.pkg ? Thank you. Bye

    Thursday, December 18, 2014 11:53 AM
  • User35201 posted

    @Tirzan - I think this is the equivalent MRE. http://storage.bos.internalx.com/mono-mac-3.10.0-branch/92/92c48842a3ff0791d996b6577265ce453ff87670/MonoFramework-MRE-3.10.0.26.macos10.xamarin.x86.pkg

    Thursday, December 18, 2014 2:51 PM
  • User94672 posted

    Thanks @chamons but the page is not found. Can yuo tell me the correct link? Or better, is there a link with the list of downloadable files in http://storage.bos.internalx.com?

    Friday, December 19, 2014 3:50 PM
  • User35201 posted

    Try this one:

    http://storage.bos.internalx.com/mono-mac-3.10.0-branch/92/92c48842a3ff0791d996b6577265ce453ff87670/MonoFramework-MRE-3.10.0.31.macos10.xamarin.x86.pkg

    And we don't have a public directory for that server.

    Friday, December 19, 2014 4:08 PM
  • User94672 posted

    It works, thanks

    Friday, December 19, 2014 4:48 PM
  • User94672 posted

    Hi chamos, i've another problem. I've asked a question but it has not yet been approved, so, since it is quite urgent, i try to ask you, in case you have time to respond. I've developed an app on a windows based pc with mono. It works correctly on osx 10.8 with MRE 3.10.0.31, but on osx 10.6.8 with MRE 3.10.0.31 it crashes with a DllNotFoundException on the file libgdiplus.dylib

    I post the complete exception and if could be useful i might post the result of MONOLOGLEVEL=debug

    Thank you in advance.

    Bye

    This is the complete exception:

    Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /Library/Frameworks/Mono.framework/Versions/3.10.0/lib/libgdiplus.dylib at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Drawing.KnownColors..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Drawing.Color.getBlack () [0x00000] in :0 at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in :0 at System.Windows.Forms.ThemeEngine..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.SystemInformation.getMenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.Control..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor () at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Control..ctor () [0x00000] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x00000] in :0 at System.Windows.Forms.Form..ctor () [0x00000] in :0 at WebLabelingClientServiceHostDesktop.MainForm..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) WebLabelingClientServiceHostDesktop.MainForm:.ctor () at WebLabelingClientServiceHostDesktop.Program.Main () [0x00000] in :0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /Library/Frameworks/Mono.framework/Versions/3.10.0/lib/libgdiplus.dylib at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Drawing.KnownColors..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Drawing.Color.getBlack () [0x00000] in :0 at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in :0 at System.Windows.Forms.ThemeEngine..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.SystemInformation.getMenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.Control..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor () at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Control..ctor () [0x00000] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x00000] in :0 at System.Windows.Forms.Form..ctor () [0x00000] in :0 at WebLabelingClientServiceHostDesktop.MainForm..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) WebLabelingClientServiceHostDesktop.MainForm:.ctor () at WebLabelingClientServiceHostDesktop.Program.Main () [0x00000] in :0

    Monday, March 9, 2015 8:24 PM
  • User94672 posted

    Hi chamos, i've another problem. I've asked a question but it has not yet been approved, so, since it is quite urgent, i try to ask you, in case you have time to respond. I've developed an app on a windows based pc with mono. It works correctly on osx 10.8 with MRE 3.10.0.31, but on osx 10.6.8 with MRE 3.10.0.31 it crashes with a DllNotFoundException on the file libgdiplus.dylib

    I post the complete exception and if could be useful i might post the result of MONOLOGLEVEL=debug

    Thank you in advance.

    Bye

    This is the complete exception:

    Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /Library/Frameworks/Mono.framework/Versions/3.10.0/lib/libgdiplus.dylib at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Drawing.KnownColors..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Drawing.Color.getBlack () [0x00000] in :0 at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in :0 at System.Windows.Forms.ThemeEngine..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.SystemInformation.getMenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.Control..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor () at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Control..ctor () [0x00000] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x00000] in :0 at System.Windows.Forms.Form..ctor () [0x00000] in :0 at WebLabelingClientServiceHostDesktop.MainForm..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) WebLabelingClientServiceHostDesktop.MainForm:.ctor () at WebLabelingClientServiceHostDesktop.Program.Main () [0x00000] in :0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /Library/Frameworks/Mono.framework/Versions/3.10.0/lib/libgdiplus.dylib at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Drawing.KnownColors..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Drawing.Color.getBlack () [0x00000] in :0 at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in :0 at System.Windows.Forms.ThemeEngine..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.SystemInformation.getMenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.Control..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor () at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Control..ctor () [0x00000] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x00000] in :0 at System.Windows.Forms.Form..ctor () [0x00000] in :0 at WebLabelingClientServiceHostDesktop.MainForm..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) WebLabelingClientServiceHostDesktop.MainForm:.ctor () at WebLabelingClientServiceHostDesktop.Program.Main () [0x00000] in :0

    Monday, March 9, 2015 8:24 PM