Bug 316735 (MONO70773) - [AMD64] Marshalling to libgdiplus fails
Summary: [AMD64] Marshalling to libgdiplus fails
Status: RESOLVED FIXED
Alias: MONO70773
Product: Mono: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-23 08:58 UTC by Thomas Harning Jr.
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Simple test case involving System.Drawing.Imaging.ImageCodecInfo:GetImageEncoders() (149 bytes, text/plain)
2004-12-23 08:59 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:02:19 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".