Bugzilla – Bug 316735
[AMD64] Marshalling to libgdiplus fails
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by harningt@gmail.com 2004-12-23 01:58:04 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: When trying to access the ImageCodecInfo instances via ImageCodecInfo.GetImageEncoders(), or when attempting to save an image, a NullRefrenceException gets thrown inside System.Runtime.InteropServices.Marshal:PtrToStringUni(intptr) [even though the actual pointer that causes the exception isn't null, but apparently unreferenceable when testing via gdb]. Steps to reproduce the problem: 1. Execute a mono application that calls System.Drawing.Imaging.ImageCodecInfo retreival functions Actual Results: Exception gets thrown - mono output: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object in <0x68ddef4b> (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:PtrToStringUni (intptr) in <0x0000f> (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:PtrToStringUni (intptr) in <0x00027> System.Drawing.GdipImageCodecInfo:MarshalTo (System.Drawing.GdipImageCodecInfo,System.Drawing.Imaging.ImageCodecInfo) in <0x00297> System.Drawing.Imaging.ImageCodecInfo:GetImageEncoders () in <0x00018> TheMain:Main (string[]) Expected Results: -- The ImageCodecInfo retrieval succeeds and no exceptions get thrown. How often does this happen? Every time a call to the functions for ImageCodecInfo retrieval. Additional Information: I had to setup the libgdiplus src/Makefile to not have -Werror due to __stdcall causing warnings due to ignorance on AMD64 and pointer casting issues. I also tried sizing all the ints that get cast to pointers up to the larger [pointer] in case pointer issues were the main trouble, and also defining __stdcall to nothing and resetting the -Werror flag to check for more warnings [none after the define and changing all 'int's that were cast to void* to void* in the first place. I'm running everything from the bleeding edge SVN sources. [keep doing svn up */ in my sources directory just about every day I work with mono's sources]. I have provided a simple test case. ---- Additional Comments From harningt@gmail.com 2004-12-23 01:59:26 MST ---- Created an attachment (id=167199) Simple test case involving System.Drawing.Imaging.ImageCodecInfo:GetImageEncoders() ---- Additional Comments From vargaz@gmail.com 2004-12-28 19:52:09 MST ---- Fixed in SVN. Imported an attachment (id=167199) Unknown operating system unknown. Setting to default OS "Other".