我们的 Unity iOS 应用程序发生了崩溃。
我们无法在调试时重现它们,但我们经常会遇到这种崩溃。
我们试图分析崩溃日志。(崩溃日志在帖子的底部)我们检查了崩溃日志中提到的部分代码(m_Controller...方法),看不到可能导致崩溃的东西。
我们试图想象那部分代码中可能发生的情况,但看不到任何可能导致崩溃的情况。有从磁盘加载并修改的小* 字符串数组。我们考虑重写这部分代码,但又担心程序的其他部分会影响并导致这个崩溃,重写后这个崩溃仍然存在。
我们尝试在这部分代码中添加try-catch块,并在异常发生时处理情况(将用户移动到我们应用程序的主菜单),但是由于我们的应用程序的要求,我们必须删除这个块。
另外,我认为崩溃仅在 Ad-hoc 构建(在 Xcode 中使用 Release 配置)中发生(或至少更频繁)。在部分崩溃日志中,您可以在 GC_malloc 中看到 mono_gc_out_of_memory,这对我来说看起来很奇怪(我认为 iOS 在内存不足时会生成内存警告,但可能 mono 有其自身的限制)
此外,这部分代码中还有另外一两次崩溃,崩溃日志不同(没有 mono_gc_out_of_memory,但是),但都发生在 ArrayList 的方法中 (其他情况下为 ArrayList.Clear())。
你能帮助我们解决这种情况吗?您能否就我们应该如何处理这种崩溃问题给我们任何建议?
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 MyApp 0x00f0e150 CrashedCheckBellowForHintsWhy() (CrashReporter.mm:73)
1 MyApp 0x00dcd888 m_wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
2 MyApp 0x01462eec mono_jit_runtime_invoke + 2152
3 MyApp 0x01504f24 mono_runtime_invoke + 132
4 MyApp 0x015050a8 mono_runtime_delegate_invoke + 128
5 MyApp 0x0150931c call_unhandled_exception_delegate + 340
6 MyApp 0x0150b230 mono_unhandled_exception + 328
7 MyApp 0x01473080 mono_handle_exception_internal + 952
8 MyApp 0x01473918 mono_handle_exception + 64
9 MyApp 0x0148f6d8 mono_arm_throw_exception + 184
10 MyApp 0x00e76ecc throw_exception + 44
11 MyApp 0x014b7f44 mono_gc_out_of_memory + 16
12 MyApp 0x0156a62c GC_generic_malloc + 452
13 MyApp 0x0156a6cc GC_malloc + 140
14 MyApp 0x015045fc mono_array_new_specific + 272
15 MyApp 0x00dd27ac m_wrapper_managed_to_native_object___icall_wrapper_mono_array_new_specific_intptr_int + 68
16 MyApp 0x00b7b2b8 m_System_Collections_ArrayList_InsertRange_int_System_Collections_ICollection + 212
17 MyApp 0x00b7b898 m_System_Collections_ArrayList_AddRange_System_Collections_ICollection + 52
18 MyApp 0x001fc3fc m_Controller_PrepareSkins_string_string_string_string_string_string_string__ + 1600
19 MyApp 0x001fda88 m_Controller_Awake + 4972