Reachability reachabilityWithHostName crashing application in release mode

2

I am facing very strange problem. I have used Reachability 3.0 in my project.

I have used following code

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil];
self.hostReachability = [Reachability reachabilityWithHostName:HOST_NAME];
[self.hostReachability startNotifier];
[self updateInterfaceWithReachability:self.hostReachability];

self.internetReachability = [Reachability reachabilityForInternetConnection];
[self.internetReachability startNotifier];
[self updateInterfaceWithReachability:self.internetReachability];

Every thing is working perfectly in simulator and devices when build configuration set to Debug mode. Now when I am making AdHoc builds for my client when build configuration set to release mode its crashing.

When I comment following code from above it works fine

self.hostReachability = [Reachability reachabilityWithHostName:HOST_NAME];

Can anyone help me in fixing this issue?

Update: My Crash log

Date/Time:       2013-09-24 12:52:39.623 +0500
OS Version:      iOS 6.1.3 (10B329)
Report Version:  104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x3b07b350 __pthread_kill + 8
1   libsystem_c.dylib               0x3aff211e pthread_kill + 54
2   libsystem_c.dylib               0x3b02e96e abort + 90
3   libsystem_c.dylib               0x3b00f4cc __assert_rtn + 176
4   SystemConfiguration             0x34a99452 SCNetworkReachabilitySetCallback + 178
5   MYAPPLICATION                           0x000bcdee 0xa1000 + 114158
6   MYAPPLICATION                           0x000a21a8 0xa1000 + 4520
7   UIKit                           0x34b2aad4 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 248
8   UIKit                           0x34b2a65e -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1186
9   UIKit                           0x34b22846 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
10  UIKit                           0x34acac34 -[UIApplication handleEvent:withNewEvent:] + 1000
11  UIKit                           0x34aca6c8 -[UIApplication sendEvent:] + 68
12  UIKit                           0x34aca116 _UIApplicationHandleEvent + 6150
13  GraphicsServices                0x367d55a0 _PurpleEventCallback + 588
14  GraphicsServices                0x367d51ce PurpleEventCallback + 30
15  CoreFoundation                  0x32c97170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
16  CoreFoundation                  0x32c97112 __CFRunLoopDoSource1 + 134
17  CoreFoundation                  0x32c95f94 __CFRunLoopRun + 1380
18  CoreFoundation                  0x32c08eb8 CFRunLoopRunSpecific + 352
19  CoreFoundation                  0x32c08d44 CFRunLoopRunInMode + 100
20  UIKit                           0x34b21480 -[UIApplication _run] + 664
21  UIKit                           0x34b1e2fc UIApplicationMain + 1116
22  MYAPPLICATION                           0x000a209a 0xa1000 + 4250
23  libdyld.dylib                   0x3afb4b1c start + 0

Thread 1:
0   libsystem_kernel.dylib          0x3b07bd98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3afc9cf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3afc9a12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3afc98a0 start_wqthread + 4

Thread 2 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0   libsystem_kernel.dylib          0x3b06b648 kevent64 + 24
1   libdispatch.dylib               0x3af9b974 _dispatch_mgr_invoke + 792
2   libdispatch.dylib               0x3af9b654 _dispatch_mgr_thread$VARIANT$mp + 32

Thread 3:
0   libsystem_kernel.dylib          0x3b07bd98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3afc9cf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3afc9a12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3afc98a0 start_wqthread + 4

Thread 4 name:  WebThread
Thread 4:
0   libsystem_kernel.dylib          0x3b06aeb4 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x3b06b048 mach_msg + 36
2   CoreFoundation                  0x32c97040 __CFRunLoopServiceMachPort + 124
3   CoreFoundation                  0x32c95d9e __CFRunLoopRun + 878
4   CoreFoundation                  0x32c08eb8 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x32c08d44 CFRunLoopRunInMode + 100
6   WebCore                         0x38c0f500 RunWebThread(void*) + 440
7   libsystem_c.dylib               0x3afd430e _pthread_start + 306
8   libsystem_c.dylib               0x3afd41d4 thread_start + 4

Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x3cb75534
r4: 0x00000006    r5: 0x3cb75b88      r6: 0x34ac01c6      r7: 0x2fd5e710
r8: 0x34ac0171    r9: 0x2fd5e660     r10: 0x3cb75608     r11: 0x20853880
ip: 0x00000148    sp: 0x2fd5e704      lr: 0x3aff2123      pc: 0x3b07b350
cpsr: 0x00000010
iphone
objective-c
reachability
asked on Stack Overflow Sep 24, 2013 by Irfan DANISH • edited Sep 24, 2013 by Irfan DANISH

1 Answer

0

Writing here just to help anyone with same problem.

I was developing application using Xcode 4.6 with Reachability version 3.0.

When I run same application using Xcode 5 it was working perfectly.

So as a work around, now I am using old version of Reachability and its working on Xcode 4.6 without any problem.

answered on Stack Overflow Oct 8, 2013 by Irfan DANISH

User contributions licensed under CC BY-SA 3.0