ConnectUsingSettings works in Unity, fails in build

Options
Hi,

I am having some issues with a very basic PUN setup. I am doing some early tests – just connecting the Photon Cloud and creating a room.

I am finding that everything works perfectly in the Unity Editor (connects and joins a room with no problems), but when I export and run a build (OS X Universal), I am getting an error. I have the latest version of PUN from the Assets Store, Unity 4.5.2f1 running on Mac OS X 10.9.4.

Any pointers on what's going wrong (or what I've done wrong) and how I can fix it would be much appreciated!

When I call ConnectUsingSettings, I get the following error, and additionally OnConnectionFail gets called with DisconnectCause.TimeoutDisconnect

Receiving unhandled NULL exception
Obtained 13 stack frames.
#0 0x0000010311ae38 in (Unknown)
#1 0x0000010bdbcb19 in System.Net.Sockets.Socket:Receive_nochecks (byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.Sockets.SocketError&) + 0xc9 (0x10bdbca50 0x10bdbcb9f) [0x1096d8cc0 - Unity Root Domain]
#2 0x0000010bdbc94b in System.Net.Sockets.Socket:Receive (byte[]) + 0x5b (0x10bdbc8f0 0x10bdbca38) [0x1096d8cc0 - Unity Root Domain]
#3 0x0000010cfe7f9f in (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) + 0x5f (0x10cfe7f40 0x10cfe8002) [0x1096d8cc0 - Unity Root Domain]
#4 0x000001018b669f in mono_jit_runtime_invoke
#5 0x000001019d928b in mono_runtime_invoke
#6 0x000001019ddfd1 in mono_runtime_delegate_invoke
#7 0x00000101a043e0 in start_wrapper
#8 0x00000101a33269 in thread_start_routine
#9 0x00000101a5927c in GC_start_routine
#10 0x007fff8b623899 in _pthread_body
#11 0x007fff8b62372a in _pthread_struct_init
#12 0x007fff8b627fc9 in thread_start

Comments

  • Tobias
    Options
    This looks like a mono runtime issue. We had another issue like this in recent Unity/OSX combinations but that logged another exception.
    See: http://forum.exitgames.com/viewtopic.php?f=6&t=4911

    The problem is: This is not something we can fix easily. For us, the cause for this is hidden in Unity's export and it might be an issue that's temporary, too.
    Please report this as bug to Unity and post the case number here (so others might refer to it).
  • Hi Tobias,

    Thanks for the quick reply. I have done some further testing and found that the issue is isolated to 64 bit builds. When building to Universal, it was defaulting to x86_64 architecture because of the system I am running.

    A temporary workaround is to build to x86 (32 bit) – in which case the error doesn't occur and everything works normally. In any case, the issue still exists in x86_64 app, so I will report the bug to Unity and update the thread.
  • Tobias
    Options
    That's a good find and I bet Unity will be quick to fix this.
    Whatever latest Unity version you can access (including beta), make sure to reproduce and report in that version. Those versions get best support.

    Thanks for the update!