[Mono-bugs] [Bug 471680] New: Marshal.PtrToStructure() error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Feb 2 15:30:22 EST 2009


           Summary: Marshal.PtrToStructure() error
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: x86-64
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: marcel.hauf at googlemail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User

Created an attachment (id=269381)
 --> (https://bugzilla.novell.com/attachment.cgi?id=269381)
Source code with monodevelop project file.

Description of Problem:
Converting a structure with Marshal.PtrToStructure() like this:
MyStruct myStruct = (MyStruct)Marshal.PtrToStructure(obj, typeof(MyStruct));
causes an error.
The pointer is invoked from an unmanaged place.

Steps to reproduce the problem:
1. Extract the provided source code.
2. Open the MonoDevelop project file.
3. Compile both projects.
4. Start the terminal application.

Actual Results:

  at (wrapper managed-to-native) object.__icall_wrapper_mono_string_new_wrapper
(intptr) <0x00059>
  at (wrapper managed-to-native) object.__icall_wrapper_mono_string_new_wrapper
(intptr) <0xffffffff>
  at (wrapper unknown) CSharp.MyStruct.PtrToStructure (intptr,object)
  at (wrapper runtime-invoke) CSharp.MyStruct.runtime_invoke_void_intptr_object
(object,intptr,intptr,intptr) <0xffffffff>
  at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal.PtrToStructure (intptr,System.Type)
  at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal.PtrToStructure (intptr,System.Type)
  at CSharp.MyClass.SaveMyStruct (intptr) <0x00037>
  at (wrapper runtime-invoke) CSharp.MyClass.runtime_invoke_void_intptr
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

Inconsistency detected by ld.so: dl-open.c: 623: _dl_open: Assertion
`_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!

Die Anwendung beendete mit Code: 127
(German to English~: The application aborted with code: 127)

Expected Results:
A successful compilation from an IntPtr to a C# struct.

How often does this happen? 
Every time.

Additional Information:
GLIB2 version: 2.18.2
GLIBC version: 2.9

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