调用ServiceStack.Text.JsConfig.RegisterTypeForAot< T>(); MonoTouch一起使用会导致设备启动时SIGSEGV [英] Calling ServiceStack.Text.JsConfig.RegisterTypeForAot<T>(); with MonoTouch causes SIGSEGV on startup on device

查看:105
本文介绍了调用ServiceStack.Text.JsConfig.RegisterTypeForAot< T>(); MonoTouch一起使用会导致设备启动时SIGSEGV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用ServiceStack.Text.JsConfig.RegisterTypeForAot();一种在运行时不使用的方法来解决我的AOT问题,但是当我对其调用过多时,又遇到了其他奇怪的问题。我接到了10个针对各种类型的调用,包括类,结构和枚举。当我打完9个电话时,一切正常,我已经改组了一些类型,所以我很确定这是电话号码。当我有10个电话时,我得到...

I've been trying to use ServiceStack.Text.JsConfig.RegisterTypeForAot(); in an method that is not used at runtime to cure my AOT issues but have run into other weird issues when I have too many calls to it. I've got 10 calls to various types including classes, structs and enums. When I have 9 calls everything works fine, I've shuffled some of the types around so I'm pretty sure it is the number. When I have 10 calls I get ...

Stacktrace:

  at System.MonoType.ToString () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/MonoType.cs:636
  at System.Exception.get_ClassName () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Exception.cs:141
  at System.Exception.ToString () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Exception.cs:286
  at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
  at System.Type.Equals (System.Type) [0x00020] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Type.cs:471
  at System.Type.IsAssignableFrom (System.Type) [0x00008] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Type.cs:863
  at System.Collections.Generic.EqualityComparer`1<intptr>..cctor () [0x00029] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs:42
  at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
  at System.Collections.Generic.Dictionary`2<intptr, System.WeakReference>.Init (int,System.Collections.Generic.IEqualityComparer`1<intptr>) [0x00012] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:265
  at System.Collections.Generic.Dictionary`2<intptr, System.WeakReference>..ctor () [0x00006] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:223
  at MonoTouch.ObjCRuntime.Runtime..cctor () <IL 0x00000, 0x0002b>
  at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

    0   TouchContainer                      0x028dbda5 mono_handle_native_sigsegv + 244
    1   TouchContainer                      0x028a3cfd mono_sigsegv_signal_handler + 172
    2   libsystem_c.dylib                   0x320e8e93 _sigtramp + 42
    3   TouchContainer                      0x0093aa25 ServiceStack_Text_Common_JsWriter_WriteEnumFlags_System_IO_TextWriter_object + 381

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

TouchContainer被应用程序的名称。

TouchContainer being the name of the app.

这似乎是在应用程序运行的早期发生的,必须是AOT中的错误或发出错误代码的东西。

This seems to be happening so early in the run of the app that it must be a bug in the AOT or something that is emitting bad code.

有人有什么想法吗?我该在Xamarin上记录票吗?看起来似乎很难完成一个小的repro项目...

Does anyone have any ideas? Shall I log a ticket with Xamarin on this? It looks like it could be tricky to work up a small repro project...

推荐答案

Rolf建议(在错误注释中)将-f添加到monotouch参数。这似乎已经解决了。

Rolf suggested (in the bug comments) adding -f to the monotouch arguments. This seems to have fixed it.

这篇关于调用ServiceStack.Text.JsConfig.RegisterTypeForAot&lt; T&gt;(); MonoTouch一起使用会导致设备启动时SIGSEGV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆