IL2CPP build crashes, Unity 5.01 and PUN 1.51

Options
Hi,

I'm trying to build my prototype using the IL2CPP scripting backend in Unity 5.01, with PUN 1.51. I'm building a Universal architecture build, with no stripping and slow/safe exceptions, targeted at iOS 8.1.

When I build and run in Xcode (debug scheme), the build will sometimes crash when I join the room, or I will be able to play one or more games before it crashes when I leave the room.

This is the callstack from Xcode:

photon receive thread (27)
#0 0x0000000101942b34 in il2cpp::os::SocketImpl::GetLastError() const at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/os/Posix/SocketImpl.cpp:556
#1 0x0000000101939464 in il2cpp::icalls::System::System::Net::Sockets::Socket::RecvFrom(Il2CppIntPtr, Il2CppArray*, int, int, il2cpp::icalls::System::System::Net::Sockets::SocketFlags, Il2CppSocketAddress**, int*) at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/icalls/System/System.Net.Sockets/Socket.cpp:715
#2 0x000000010092e02c in Socket_RecvFrom_internal_m11923(Object_t*, IntPtr_t74, ByteU5BU5D_t21*, int, int, int, SocketAddress_t2334**, int*, MethodInfo*) at /Users/stevejopling/Dev/Prototypes/trunk/iOS_Release/Classes/Native/Bulk_System_0.cpp:37854
#3 0x000000010092e134 in Socket_ReceiveFrom_nochecks_exc_m11925(Socket_t1852*, ByteU5BU5D_t21*, int, int, int, EndPoint_t2328**, bool, int*, MethodInfo*) at /Users/stevejopling/Dev/Prototypes/trunk/iOS_Release/Classes/Native/Bulk_System_0.cpp:37875
#4 0x000000010092dbf4 in Socket_Receive_nochecks_m11952(Socket_t1852*, ByteU5BU5D_t21*, int, int, int, int*, MethodInfo*) at /Users/stevejopling/Dev/Prototypes/trunk/iOS_Release/Classes/Native/Bulk_System_0.cpp:39245
#5 0x000000010092da58 in Socket_Receive_m10137(Socket_t1852*, ByteU5BU5D_t21*, MethodInfo*) at /Users/stevejopling/Dev/Prototypes/trunk/iOS_Release/Classes/Native/Bulk_System_0.cpp:37624
#6 0x00000001007aa1fc in SocketUdp_ReceiveLoop_m9774(SocketUdp_t1861*, MethodInfo*) at /Users/stevejopling/Dev/Prototypes/trunk/iOS_Release/Classes/Native/Bulk_Photon3Unity3D_0.cpp:66573
#7 0x0000000100d83f20 in ThreadStart_Invoke_m22477(ThreadStart_t1458*, MethodInfo*) at /Users/stevejopling/Dev/Prototypes/trunk/iOS_Release/Classes/Native/Bulk_mscorlib_8.cpp:5146
#8 0x0000000100d858b0 in RuntimeInvoker_Void_t27(MethodInfo*, void*, void**) at /Users/stevejopling/Dev/Prototypes/trunk/iOS_Release/Classes/Native/GeneratedInvokers.cpp:12
#9 0x0000000101957630 in il2cpp::vm::Runtime::DelegateInvoke(Il2CppDelegate*, void**, Il2CppObject**) ()
#10 0x0000000101937058 in RunThreadWrapper at /Users/builduser/buildslave/unity/build/Runtime/Threads/Thread.cpp:51
#11 0x000000010193d730 in RunThreadWrapper at /Users/builduser/buildslave/unity/build/Runtime/Threads/Thread.cpp:44
#12 0x0000000101945680 in il2cpp::os::ThreadImpl::ThreadStartWrapper(void*) at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/os/Posix/ThreadImpl.cpp:107

The crash always occurs in the GetLastError call.

Is this a known problem with Unity 5.01 and PUN 1.51?

Thanks

Steve Jopling
Hutch Games Ltd

Comments

  • SteveJ
    Options
    Has anyone been able to successfully do an IL2CPP build with Unity 5.0.1?

    Just bumping this in case anyone else has seen the above crash?

    Thanks

    Steve
  • dontonka
    Options
    Hello SteveJ.

    Personally, I'm still on PUN+ v1.28 and Unity 4.5.5p5 and it is working so well, honestly afraid to upgrade :). But I I'll have no choice since otherwise I will not be able to deploy on iOS, as building for 64bits is a must since February. I might not upgrade to Unity 5.x, but rather 4.6.x, which also support 64bits.. I'm just not sure until when Unity 4.x will be maintained, if you guys know that anwser please let me know :).

    One note regarding your problem. You seems to be using PUN, and not PUN+. The implementation of the Photon is totally different in those 2 products as far as I understand, as PUN+ is using native code, while PUN rely on C# Socket class, that is also why PUN cannot deploy on mobile actually without having Unity Pro, while PUN+ can. You might want to think about investing 100$ to get PUN+ and give it a try. Eventually, you will probably have to go that way anyway.

    Cheers,
    Don T.
  • I can confirm PUN+ does not crash like that.
    I was getting desperate waiting for Unity's IL2CPP team to fix the issues with C# sockets, so I risked upgrading to PUN+ a little early than I had to and it worked.

    I'm using 5.0.0p3 and PUN+ 1.51.

    [EDIT]
    If you have time to publish, I recommend waiting for the IL2CPP fixes and building with Mono still for now. Since Unity 5 there is no limitation to the free version when it comes to sockets, so the only reason to upgrade to PUN+ then would be if you wanted the bonus hosting plan that comes with it.
    [/EDIT]