Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

B14: NullReferenceException in String.memcpy4 during Network.Update

Discussion in 'Unity 5 Pre-order Beta' started by chrismarch, Dec 3, 2014.

  1. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    472
    When I connect a stand alone build to the Unity Editor, as client/server, I get spammed with NullReferenceException errors, which I believe is new in B14. Do these callstacks look familiar? It seems to happen in Network.Update, if I understand what I am seeing in the Profiler. Our C# scripts do not call String.memcpy directly, but I suspect it is happening in relation to a Network.OnSerializeNetworkView, but I could be wrong. I'm trying to disable our serialization one by one at the moment...

    EDIT: also, is there a way I can get the full callstacks or argument values below?

    MonoDevelop:

    string.memcpy4 (dest=0x28e11c, src=(null), size=24) in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:2864
    string.memcpy (dest=0x28e11c, src=(null), size=24) in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:2956

    Unity Editor Console:
    NullReferenceException: Object reference not set to an instance of an object
    System.String.memcpy4 (System.Byte* dest, System.Byte* src, Int32 size) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:2864)
    System.String.memcpy (System.Byte* dest, System.Byte* src, Int32 size) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:2956)
     
  2. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    472
    I've commented out all of our OnSerializeNetworkView function bodies, and I still get the exceptions from String.memcpy. While the server is running in the editor, I change the Sendrate value in the menu Edit/Project Settings/Network, and I observe 24 of the NullReferenceErrors per (what appears to be) network send. So, with a Sendrate of 1, I see 24 all at once, and then about a 1 second delay, while increasing to 15 results in 24 per 1/15 of a second roughly.

    EDIT: that's one exception per enabled NetworkView in the scene that is using State Synchronization (Reliable Delta Compressed)
     
    Last edited: Dec 3, 2014