Couchbase.lite-net Unity iOS - Spaceshooter - Crash with SIGSEGV

Hi everyone,

I have tried to run the space-shooter app (https://github.com/couchbaselabs/mini-hacks/tree/master/space-shooter) for Unity and it works fine when ran from the editor on Windows 10 and MacOSX but crashes when installed on my iPads (iOS).

Here are the things I have tried:

  • Downgrading to Unity 5.1.2f3 (this one is the recommended version for the space-shooter project)
  • Deploying the application on iPad of different memory capacity
  • Upgrading the Couchbase Lite for Unity set of sources with the latests available on the Couchbase website (unity_v1.0-beta3).

Investigation shows that the program crashes on Couchbase Lite APIs specific calls only. After deactivating all the Couchbase Lite specific calls, the original space-shooter program works fine.
Calls like:

    var pull = db.CreatePullReplication(SYNC_URL);
    pull.Start(); // Crash

Is this because Couchbase lite for Unity is still in beta? Or is it already supposed to work?

I am using Xcode 8.2.1, tried 10.3 too.

If that helps I am leaving here the back trace.
Thanks a lot for your assistance!

  • thread #1: tid = 0x122aa, 0x1d591acc libsystem_kernel.dylib__pthread_kill + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSEGV frame #0: 0x1d591acc libsystem_kernel.dylib__pthread_kill + 8
    frame #1: 0x1d64a0f6 libsystem_pthread.dylibpthread_kill + 62 frame #2: 0x1d4f785e libsystem_c.dylibraise + 16
    frame #3: 0x02557840 SpacesShooterTestg_logv + 164 frame #4: 0x02557868 SpacesShooterTestg_log + 32
    frame #5: 0x0245f670 SpacesShooterTestget_numerous_trampoline + 372 frame #6: 0x0245fc3c SpacesShooterTestmono_aot_get_imt_thunk + 64
    frame #7: 0x024fd084 SpacesShooterTestinitialize_imt_slot + 116 frame #8: 0x024fdf3c SpacesShooterTestbuild_imt_slots + 684
    frame #9: 0x024fe124 SpacesShooterTestmono_vtable_build_imt_slot + 264 frame #10: 0x0246e1e0 SpacesShooterTestmono_convert_imt_slot_to_vtable_slot + 240
    frame #11: 0x0246bc4c SpacesShooterTestmono_magic_trampoline + 792 frame #12: 0x01975d88 SpacesShooterTestgeneric_trampoline_0 + 120
    • frame #13: 0x008a6884 SpacesShooterTestm_System_Net_Http_Headers_HttpHeaders_Add_string_System_Collections_Generic_IEnumerable_1_string + 88 at System.Net.Http.Net35.dll.s:5158 frame #14: 0x0008b76c SpacesShooterTestm_Couchbase_Lite_Replication_SendAsyncRequest_System_Net_Http_HttpMethod_System_Uri_object_Couchbase_Lite_Support_RemoteRequestCompletionBlock_System_Threading_CancellationTokenSource + 340 at Couchbase.Lite.dll.s:10293
      frame #15: 0x0008b4dc SpacesShooterTestm_Couchbase_Lite_Replication_SendAsyncRequest_System_Net_Http_HttpMethod_string_object_Couchbase_Lite_Support_RemoteRequestCompletionBlock_System_Threading_CancellationTokenSource + 168 at Couchbase.Lite.dll.s:10203 frame #16: 0x0008a8c4 SpacesShooterTestm_Couchbase_Lite_Replication_FetchRemoteCheckpointDoc + 324 at Couchbase.Lite.dll.s:9791
      frame #17: 0x0008a448 SpacesShooterTestm_Couchbase_Lite_Replication_CheckSession + 124 at Couchbase.Lite.dll.s:9633 frame #18: 0x0008e6b8 SpacesShooterTestm_Couchbase_Lite_Replication_Start + 400 at Couchbase.Lite.dll.s:11800
      frame #19: 0x00074588 SpacesShooterTestm_GameController__Startc__Iterator4_MoveNext + 260 at Assembly-CSharp.dll.s:1995 frame #20: 0x018cdf14 SpacesShooterTestm_46b5 + 204 at mscorlib.dll.s:367212
      frame #21: 0x0245a1d4 SpacesShooterTestmono_jit_runtime_invoke + 2156 frame #22: 0x024fc6a4 SpacesShooterTestmono_runtime_invoke + 136
      frame #23: 0x01ca0d90 SpacesShooterTest::Invoke() + 48 at ScriptingInvocation.cpp:130 [opt] frame #24: 0x01ca0cac SpacesShooterTest::Invoke() + 32 at ScriptingInvocation.cpp:80 [opt]
      frame #25: 0x01c95498 SpacesShooterTest::InvokeMoveNext() + 84 at Coroutine.cpp:201 [opt] frame #26: 0x01c951c0 SpacesShooterTest::Run() + 48 at Coroutine.cpp:226 [opt]
      frame #27: 0x01c9728c SpacesShooterTest::CreateCoroutine() + 292 at MonoBehaviour.cpp:770 [opt] frame #28: 0x01c97640 SpacesShooterTest::HandleCoroutineReturnValue() + 100 at MonoBehaviour.cpp:825 [opt]
      frame #29: 0x01c97d38 SpacesShooterTest::InvokeMethodOrCoroutineChecked() + 116 at MonoBehaviour.cpp:929 [opt] frame #30: 0x01c96aa8 SpacesShooterTest::DelayedStartCall() [inlined] Start + 108 at MonoBehaviour.cpp:552 [opt]
      frame #31: 0x01c96a4c SpacesShooterTest::DelayedStartCall() + 16 at MonoBehaviour.cpp:1297 [opt] frame #32: 0x01b8f958 SpacesShooterTest::Update() + 744 at CallDelayed.cpp:178 [opt]
      frame #33: 0x01c4b674 SpacesShooterTest::PlayerLoop() + 560 at Player.cpp:1722 [opt] frame #34: 0x01a0f704 SpacesShooterTest::UnityPlayerLoopImpl() + 20 at LibEntryPoint.mm:237 [opt]
      frame #35: 0x00048e7c SpacesShooterTest::UnityRepaint() + 60 at UnityAppController+Rendering.mm:246 frame #36: 0x00068f8c SpacesShooterTest::-UnityAppController(self=0x14e2e460, _cmd=“showGameUI”) showGameUI + 504 at UnityAppController+ViewHandling.mm:168
      frame #37: 0x00062140 SpacesShooterTest::-[UnityAppController startUnity:](self=0x14e2e460, _cmd="startUnity:", application=0x14e43830) + 652 at UnityAppController.mm:112 frame #38: 0x1e6f602e Foundation__NSFireDelayedPerform + 458
      frame #39: 0x1dd80636 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14 frame #40: 0x1dd80338 CoreFoundation__CFRunLoopDoTimer + 832
      frame #41: 0x1dd7fd36 CoreFoundation__CFRunLoopDoTimers + 188 frame #42: 0x1dd7ddd4 CoreFoundation__CFRunLoopRun + 780
      frame #43: 0x1dcd10ee CoreFoundationCFRunLoopRunSpecific + 470 frame #44: 0x1dcd0f10 CoreFoundationCFRunLoopRunInMode + 104
      frame #45: 0x1f47bb40 GraphicsServicesGSEventRunModal + 80 frame #46: 0x2304fe82 UIKitUIApplicationMain + 150
      frame #47: 0x00038e74 SpacesShooterTestmain(argc=1, argv=0x05eeba08) + 244 at main.mm:32 frame #48: 0x1d4be4ea libdyld.dylibstart + 2

Obviously it worked the last time I checked, but actually support for Unity3D is on hold until at least after they upgrade their .NET profile so I haven’t touched it in probably a year or so and it is still based off of v1.1.1 which reached its end of life months ago. It was too much of a time sink to maintain the library for such an old runtime.

Hi,

Thanks for your answer!
I see that the upgrade of the .NET profile should come with Unity 2017.1, target release around July 2017!
So it should be coming very soon!

We’ll be patient then.
Thanks!
Franck