Crash with latest Unity 2017.2

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

brockemon
Posts: 54
Joined: 25 Jan 2012, 17:20

Crash with latest Unity 2017.2

Postby brockemon » 16 Nov 2017, 23:45

Hi,

Been using smartfox to develop our new game for a few years now. After the latest unity update to 2017.2.0f3 the client crashes after closing a game room and closing down the connection to smartfox. The error is:

[SFS - ERROR] [TCPSocketLayer] General error reading data from socket: Read failure at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
11-16 15:40:39.389 7092 7218 D Unity : at Sfs2X.Core.Sockets.TCPSocketLayer.Read () [0x00000] in <filename unknown>:0

It happens during the Sfs2X.SmartFox:ProcessEvents().

Is there anything I can to stop this crash? Try, Catch doesn't seem to do anything.

-Brock
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Crash with latest Unity 2017.2

Postby Lapo » 17 Nov 2017, 08:49

Hi,
when you say "the client" what are you referring to exactly? I mean what platform are building for?
Can you reproduce it in the Editor?

I have to say, unfortunately, if this happens by upgrading Unity I fear the problem is Unity itself which might have changed something in the lower level compiler/transpiler. In any case let us know the details and we'll investigate on our end.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
brockemon
Posts: 54
Joined: 25 Jan 2012, 17:20

Re: Crash with latest Unity 2017.2

Postby brockemon » 17 Nov 2017, 17:03

Unity 2017.2.0f3 building for Android. It may be something I am doing wrong, like closing a connection to the server at a wrong time, although I didn't know that was possible.

All I know is that I hadn't changed any of my own code and the only thing that changed was updating to that version of unity.
brockemon
Posts: 54
Joined: 25 Jan 2012, 17:20

Re: Crash with latest Unity 2017.2

Postby brockemon » 17 Nov 2017, 17:25

When running in the Unity Editor I get no errors
brockemon
Posts: 54
Joined: 25 Jan 2012, 17:20

Re: Crash with latest Unity 2017.2

Postby brockemon » 17 Nov 2017, 18:19

The problem seemed to be fixed by calling KillConnection vs Disconnect when I was shutting down the connection to Smartfox on the Android Client.

After a game ends I do

sfs.RemoveAllEventListeners();
sfs.KillConnection ();
// sfs.Disconnect ();
sfs = null;

This change stops the crashing but I don't really get why.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Crash with latest Unity 2017.2

Postby Lapo » 18 Nov 2017, 09:03

Interesting. Thanks for reporting, we'll investigate.
I fear it has to do with low level changes in the Android runtime, introduced with the latest Unity

We'll report back if we find more clues.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Crash with latest Unity 2017.2

Postby Lapo » 20 Nov 2017, 15:05

UPDATE:
We have done a few tests with the latest Unity 2017.2, exporting a simple connector to Android.
Using the BlueStacks emulator we're not able to reproduce any of the issues you have reported, so I am inclined to think this might be an issues with specific versions of the OS or a specific device?

Have you tested on multiple devices? If so which Android do they run?
Also which version of the Android SDK do you use?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 28 guests