Page 1 of 1

UDPController SIGABRT

Posted: 19 Nov 2013, 22:41
by Fellow
Hi,

We want to update our iOS SFS library from 1.1.5 to 1.2.1 but we are running into a problem.
The UDPController crashes when trying to connect. The attachment shows the crash.

This is our setup:

Code: Select all


- (void)initializeSF
{
    _smartFox = [SmartFox2XClient smartFoxWithDebugMode:NO delegate:self];
    [_smartFox connect:_server port:_port];
}

- (void)onConnection:(SFSEvent *)evt
{
    [_smartFox send:[LoginRequest requestWithUserName:_username
                                             password:[_password sha256]
                                             zoneName:ZONE
                                               params:param]];
}

- (void)onLogin:(SFSEvent *)evt
{
    [_smartFox initUDP:_server :9933];
}

- (void)onUDPSocketConnect:(SFSEvent *)evt
{
    [self performRoomJoin];
}




Here's the debug info just before the crash:

Code: Select all

2013-11-19 14:05:35.025 DevProject[2975:60b] Trying to initialize the UDP controller..
2013-11-19 14:05:35.027 DevProject[2975:60b] [SFS - INFO]Data Read: Binary Size: 57
80 00 36 12 00 03 00 01 61 03 00 0d 00 01 63 02    ..6.....a.....c.
01 00 01 70 12 00 02 00 01 63 08 00 01 69 00 01    ...p.....c...i..
70 12 00 03 00 01 61 03 00 08 00 01 76 08 00 03    p.....a.....v...
31 2e 32 00 01 69 03 00 00                         1.2..i...       
2013-11-19 14:05:35.032 DevProject[2975:60b] [SFS - INFO]{ Message id: 13 }
{Dump: }

   (utf_string) c: i
   (sfs_object) p:
      (short) a: 8
      (utf_string) v: 1.2
      (short) i: 0
   
2013-11-19 14:05:35.037 DevProject[2975:60b] [SFS - INFO]UDP Handshake written: Binary Size: 36
80 00 21 12 00 04 00 01 69 05 00 00 00 00 00 00    ..!.....i.......
00 01 00 01 75 04 00 00 00 15 00 01 63 02 01 00    ....u.......c...
01 68 02 01                                        .h..   


Any help on this issue would be very appreciated.

Thanks,
Jonas

Re: UDPController SIGABRT

Posted: 20 Nov 2013, 10:03
by Lapo
Hi,
thanks for reporting.

Also are you testing in the emulator or on a device?

Thanks

Re: UDPController SIGABRT

Posted: 20 Nov 2013, 10:43
by Lapo
UPDATE: I was able to reproduce the issue, we're now looking into it. I'll post an update as soon as possible.

Minor suggestion. Instead of this:

Code: Select all

[_smartFox initUDP:_server :9933];


you can use this:

Code: Select all

[_smartFox initUDP:_smartFox.config.host :_smartFox.config.port];

in other words you can read the configuration from the API directly.

Thanks

Re: UDPController SIGABRT

Posted: 20 Nov 2013, 19:11
by Fellow
Thanks for the update.

Same issue on both the device and the simulator.

Some more info:

Code: Select all

2013-11-20 10:37:44.683 DevProject[11447:a0b] [SFS - INFO]UDP Handshake written: Binary Size: 36
80 00 21 12 00 04 00 01 69 05 00 00 00 00 00 00    ..!.....i.......
00 01 00 01 75 04 00 00 00 1a 00 01 63 02 01 00    ....u.......c...
01 68 02 01                                        .h..           
DevProject(11447,0x4fd1a28) malloc: *** error for object 0xe5302b0: double free
*** set a breakpoint in malloc_error_break to debug


Thanks!
Jonas

Re: UDPController SIGABRT

Posted: 28 Nov 2013, 09:14
by Lapo
UPDATE: we have fixed the problem and have completed a number of tests.
It would be great if you could test it too and confirm that the problem is fixed in your specific case too.

You can download the updated framework from here.

Let us know your feedback.

Re: UDPController SIGABRT

Posted: 28 Nov 2013, 22:21
by Fellow
I've updated the library to 1.2.2 and the issue seems fixed!

Thanks for the update.

Jonas

Re: UDPController SIGABRT

Posted: 29 Nov 2013, 08:49
by Lapo
Thanks for the feedback, we have finished testing and we'll publish the new update in the next days.

Re: UDPController SIGABRT

Posted: 02 Dec 2013, 07:23
by dangtao
Fellow wrote:I've updated the library to 1.2.2 and the issue seems fixed!

Thanks for the update.

Jonas


I came across the same issue and nothing's changed when I've updated the library to 1.2.2.

2013-12-02 14:44:04.473 SpriteWalkthrough[3644:70b] login success
2013-12-02 14:44:04.942 SpriteWalkthrough[3644:70b] [SFS - INFO]UDP Handshake written: Binary Size: 36
80 00 21 12 00 04 00 01 69 05 00 00 00 00 00 00 ..!.....i.......
00 01 00 01 75 04 00 00 00 07 00 01 63 02 01 00 ....u.......c...
01 68 02 01 .h..
SpriteWalkthrough(3644,0x23d41a8) malloc: *** error for object 0x98612d0: double free
*** set a breakpoint in malloc_error_break to debug

my code:
- (void)onLogin:(SFSEvent *)evt
{
NSLog(@"login success");

// init UDP
[self.sfsClient initUDP:@"192.168.1.105" :9933];
}

I do not know how to fix. please give me a hand. thanks.

Re: UDPController SIGABRT

Posted: 02 Dec 2013, 08:32
by Lapo
Are you sure you're using version 1.2.2?
Have you double checked by printing out the version number in the console?

Re: UDPController SIGABRT

Posted: 02 Dec 2013, 09:11
by dangtao
Lapo wrote:Are you sure you're using version 1.2.2?
Have you double checked by printing out the version number in the console?


Yes, you are right.
I forgot to remove the old path of version 1.2.1...
Now, it's working. Thanks for replying ^^

Re: UDPController SIGABRT

Posted: 02 Dec 2013, 10:05
by Lapo
Great, thanks.

Re: UDPController SIGABRT

Posted: 02 Dec 2013, 10:54
by Lapo
The API 1.2.2 are now fully available for download.
http://www.smartfoxserver.com/download/sfs2x#p=client