Forum Mobile Obj-C Socket Connection Crash

Everything mobile goes here.

Obj-C Socket Connection Crash

Postby frank84 » April 6th, 2014, 5:37 pm

I am using the 3.0.2 Obj-C SDK and am getting this exact crash: http://stackoverflow.com/questions/1790 ... on-crashes. I request some data from my C# server, which then does a player.Send with a JSON string. This call works about 5 to 9 times with the exact same data and then crashes. The server doesn't show any errors while debugging and the room remains open. The exact same Flash code works with the Flash version of the SDK and it works fine.

Any thoughts on this or tips on how I can debug this further?
Last edited by frank84 on April 8th, 2014, 2:20 am, edited 1 time in total.
frank84
 
Posts: 27
Joined: November 23rd, 2013, 2:09 am

Re: Obj-C Socket Connection Crash

Postby frank84 » April 7th, 2014, 10:07 pm

Here's the stack:
http://pastebin.com/UftVvfsM

I also found this similar crash someone was having in their library (https://github.com/snej/MYNetwork/issues/9). The cause in that one had to do with ARC and opening and closing connections rapidly. Although in my case, I am not opening new connections. Just sending and receiving a message. Our project does not use ARC.
frank84
 
Posts: 27
Joined: November 23rd, 2013, 2:09 am

Re: Obj-C Socket Connection Crash

Postby frank84 » April 9th, 2014, 12:17 am

I have been doing some tests and it looks like this is somehow related to the amount of data I am sending in the message from the server. I also switched the data over to a base64 encoded string just incase the json was causing an issue. A message sent from the server with a string argument of 2850 characters has about a 50% chance of crashing. The only limit I know of is the 500KB per database object, which I am under. This works fine with the Flash SDK and there is no issue with sending a large message from the Obj-C client to the C# server.

Is anyone else having these issues with the Objective-C SDK?
frank84
 
Posts: 27
Joined: November 23rd, 2013, 2:09 am

Re: Obj-C Socket Connection Crash

Postby frank84 » April 11th, 2014, 4:49 am

I have created a basic C# Server and Obj-C Client sample to demonstrate this bug. In the Game.cs server code, note that sending the 4 thousand character string causes a crash 100% of the time, but sending the 400 character string can be spammed. All you need to edit on the Obj-C side is put your gameID and ip address in MainViewController.m. Also note that the very first time you try connect to the server, nothing happens (a different bug:https://gamesnet.yahoo.com/forum/viewtopic.php?f=15&t=35565).

https://www.dropbox.com/s/ocygc314z3vab ... shTest.zip
frank84
 
Posts: 27
Joined: November 23rd, 2013, 2:09 am

Re: Obj-C Socket Connection Crash

Postby Henrik » April 11th, 2014, 9:21 pm

Hey Frank84,

Thanks for the detailed bug description and reproducability, it will help us a lot in fixing it!
Henrik
.IO
 
Posts: 1832
Joined: January 4th, 2010, 1:53 pm

Re: Obj-C Socket Connection Crash

Postby frank84 » April 16th, 2014, 12:09 am

Hey guys just checking in to see if you guys had any luck reproducing this bug and if there are any updates on a possible fix.
frank84
 
Posts: 27
Joined: November 23rd, 2013, 2:09 am


Return to Mobile