Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tritao
Created July 15, 2015 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tritao/7e62c71ffe57d6bc326e to your computer and use it in GitHub Desktop.
Save tritao/7e62c71ffe57d6bc326e to your computer and use it in GitHub Desktop.
using System;
using System.Runtime.InteropServices;
public unsafe partial class Qux
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct Internal
{
[FieldOffset(0)]
public fixed int array[3];
}
}
public class Program
{
[DllImport("CSharpTemp.Native", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN3Baz9returnQuxEv")]
internal static extern Qux.Internal ReturnQux_0(global::System.IntPtr instance);
static void Main(string[] args)
{
ReturnQux_0(IntPtr.Zero);
}
}
@tritao
Copy link
Author

tritao commented Jul 15, 2015

* Assertion at mini-amd64.c:906, condition `class1 != ARG_CLASS_NO_CLASS' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at Program.Main (string[]) <0x0000f>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        mono() [0x4b20bc]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f477d6ef340]
        /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f477d350cc9]
        /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f477d3540d8]
        mono() [0x6294f9]
        mono() [0x629707]
        mono() [0x629856]
        mono() [0x4e37dd]
        mono() [0x4e3fe2]
        mono() [0x4e6891]
        mono() [0x437da6]
        mono() [0x45e167]
        mono() [0x42b08f]
        mono() [0x42c84f]
        mono() [0x42d24b]
        mono() [0x42c53e]
        mono() [0x42d24b]
        mono() [0x4b4671]
        [0x41aed166]

Debug info from gdb:


=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted (core dumped)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment