Xamarin Mono调试器硬崩溃:malloc:**未分配被释放的对象/指针的错误

Xamarin Mono调试器硬崩溃:malloc:**未分配被释放的对象/指针的错误,xamarin,mono,moq,xamarin-studio,visual-studio-mac,Xamarin,Mono,Moq,Xamarin Studio,Visual Studio Mac,在使用任何类型的mock(Moq、fakeetisy、创建带有Castle.Core的代理等)时,我在Xamarin Studio或VS4M中调试测试(TDD)时在Mono调试器中遇到了硬崩溃 Mono.Debugger.Soft.CommandException: Debuggee returned error code 200. at Mono.Debugger.Soft.VirtualMachine.ErrorHandler (System.Object sender, Mono.De

在使用任何类型的mock(Moq、fakeetisy、创建带有Castle.Core的代理等)时,我在Xamarin Studio或VS4M中调试测试(TDD)时在Mono调试器中遇到了硬崩溃

Mono.Debugger.Soft.CommandException: Debuggee returned error code 200.
  at Mono.Debugger.Soft.VirtualMachine.ErrorHandler (System.Object sender, Mono.Debugger.Soft.ErrorHandlerEventArgs args) [0x0006f] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:350 
  at Mono.Debugger.Soft.Connection.SendReceive (Mono.Debugger.Soft.Connection+CommandSet command_set, System.Int32 command, Mono.Debugger.Soft.Connection+PacketWriter packet) [0x000fe] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1545 
  at Mono.Debugger.Soft.Connection.Type_GetPropertyCustomAttributes (System.Int64 id, System.Int64 field_id, System.Int64 attr_type_id, System.Boolean inherit) [0x00000] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:2239 
  at Mono.Debugger.Soft.PropertyInfoMirror.GetCAttrs (Mono.Debugger.Soft.TypeMirror type, System.Boolean inherit) [0x0003d] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/PropertyInfoMirror.cs:128 
  at Mono.Debugger.Soft.PropertyInfoMirror.GetCustomAttributes (System.Boolean inherit) [0x00000] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/PropertyInfoMirror.cs:113 
  at Mono.Debugging.Soft.SoftDebuggerAdaptor.OnGetTypeDisplayData (Mono.Debugging.Evaluation.EvaluationContext ctx, System.Object type) [0x00190] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs:1626     0   mono                                0x00111a66 mono_handle_native_sigsegv + 342
    1   mono                                0x00168561 sigabrt_signal_handler + 145
    2   libsystem_platform.dylib            0x9ebdd79b _sigtramp + 43
    3   ???                                 0xffffffff 0x0 + 4294967295
    4   libsystem_c.dylib                   0x94016c38 abort + 156
    5   libsystem_malloc.dylib              0x9ba0d292 free + 433
    6   mono                                0x00142d88 debugger_thread + 29784
    7   mono                                0x0039e56d inner_start_thread + 413
    8   libsystem_pthread.dylib             0x94644780 _pthread_body + 138
    9   libsystem_pthread.dylib             0x946446f6 _pthread_body + 0
    10  libsystem_pthread.dylib             0x94641f7a thread_start + 34
任何人都有解决方法:(除了使用Windows/VS/.Net;-)

公共接口IFoo
{
空心钢筋();
}
[TestFixture()]
公开课考试
{
[测试()]
公共无效测试用例()
{
var inspectMeForAHardCrash=new Moq.Mock();
//仅供参考:非输入将导致调试器出错,但不会导致硬崩溃
}
}
  • Mono JIT编译器版本4.8.0(Mono-4.8.0-branch/0494d70 Thu Mar 2 21:19:48 EST 2017)

public interface IFoo
{
    void Bar();
}

[TestFixture()]
public class Test
{
    [Test()]
    public void TestCase()
    {
        var inspectMeForAHardCrash = new Moq.Mock<IFoo>();
        // FYI: Non-inpection will cause the debugger to fault, but no hard crash
    }
}