[Mono-bugs] [Bug 657656] New: Got exception and program crashes when marshalling TextWriter object

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 6 02:20:57 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=657656

https://bugzilla.novell.com/show_bug.cgi?id=657656#c0


           Summary: Got exception and program crashes when marshalling
                    TextWriter object
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.8.x
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: interop
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: liewang at cisco.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Trident/4.0; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR
3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

On Microsoft CLR, automatical TextWriter <-> FILE * conversion during
marshalling is supported. However, when I tried to do it in MONO, it throws an
exception saying "StructLayout attribute must be applied to TextWriter class"
and my program crashes.

Reproducible: Always

Steps to Reproduce:
1. Create a native function dealing with FILE * parameter.
2. Create a managed program and declare an interop function with corresponding
TextWriter parameter.
3. Create a StreamWriter instance to some local file and then call the interop
function with the StreamWriter instance.
Actual Results:  
MONO throws an exception saying "StructLayout attribute must be applied to
TextWriter class" and my program crashes.

Expected Results:  
No exception and native function should receive a FILE * parameter.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list