Lots of Crashes on Windows Store

Options
Hello guys i have lots of crashes in windows dashboard. maybe anyone has some thoughts about this

STOWED_EXCEPTION_System.NullReferenceException_80004003_Photon3Unity3D.dll!ExitGames.Client.Photon.SocketUdpNetFxCore.OnConnected

Comments

  • dweebster
    Options
    Hey there!

    I have this same problem too. Now over 30 crashes per day with that error code.

    Any news on a fix for this?
  • Tobias
    Options
    Is there any additional debug info?
    It could be related to connecting or sending issues. Without any insight, this is hard to fix.

    You guys also need to let us know which version of our libs you use and which Unity version.
  • dweebster
    Options
    Hi @Tobias

    Sorry to say that there is not additional info. I have not been able to reproduce the issue myself so I only get that from the Microsoft Dev Center.

    I'm on:
    Unity 5.3.5f1
    PUN v1.71 (15. June 2016). Will try to upgrade to 1.72 now.
  • Tobias
    Options
    It could be related to losing connection but unless we can somehow reproduce it, it's tricky to fix "something".

    You could try what happens when you turn off the WiFi that the device is using? Maybe it's happening even then only in a few cases though.
  • dweebster
    Options
    Hi @Tobias

    Following your advice I put my test phone into flight mode and now I'm able to replicate the crash.

    As you said it happens when Photon is trying to make the initial connection.

    What kind of info do you need?

    From Visual Studio Community I can pull out the following info:
    StackTrace " at ExitGames.Client.Photon.SocketUdpNetFxCore.OnConnected(IAsyncAction asyncinfo, AsyncStatus asyncstatus)" string

    Exception thrown: 'System.NullReferenceException' in Photon3Unity3D.ni.DLL
    Unhandled 'Platform.NullReferenceException' exception caught! - 'Invalid pointer

    System.NullReferenceException: Object reference not set to an instance of an object.
    at ExitGames.Client.Photon.SocketUdpNetFxCore.OnConnected(IAsyncAction asyncinfo, AsyncStatus asyncstatus)', Sender: ''. Missing try/catch blocks.

    Let me know what more info you need.

  • dweebster
    Options
    Hi @Tobias

    I've found a way to avoid the crash, its not pretty but works.

    Just added:
    public App()
    {
     this.InitializeComponent();
     appCallbacks = new AppCallbacks();
    
     UnhandledException += App_UnhandledException;
    }
    
    Then ignore it if its related to Photon3Unity3D
    
     void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
     {
     System.Diagnostics.Debug.WriteLine("Crash detected: " + e.Exception.Message + " stack:" + e.Exception.StackTrace);
    
     //Tell Windows that its all fine ;)
     if(e.Exception.Source.Contains("Photon3Unity3D"))
        e.Handled = true;
    
     if (System.Diagnostics.Debugger.IsAttached)
     {
       // An unhandled exception has occurred; break into the debugger
       System.Diagnostics.Debugger.Break();
      }
    }
    
  • Tobias
    Options
    We found that some bugs slipped into the Metro and UWP library builds. Those are fixed and tested now and PUN v1.74 and up should be OK.
  • dweebster
    Options
    Great thanks @Tobias I tried the build and it seems to work better.
  • Tobias
    Tobias admin
    edited August 2016
    Options
    Thanks for the feedback.
    Better? Sounds like it's not yet optimal?

    I will release PUN v1.74 today or tomorrow. It has the new libs and fixes.