Intermittent iPad app crash using Swift - crash

I have been seeing the following crash intermittently in my app. Following is the crash log for the crash. I am not able to figure out the cause for this crash. I would really appreciate if anyone could help me with the reason behind this crash.
CRASHLOG:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000000000defe
Triggered by Thread: 5
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x34515648 syscall_thread_switch + 8
1 libsystem_platform.dylib 0x345a2646 _OSSpinLockLockSlow$VARIANT$mp + 42
2 CFNetwork 0x25df2f7e _BrowserCancel(__CFNetServiceBrowser*) + 22
3 CoreFoundation 0x2631f804 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
4 CoreFoundation 0x2631ec16 __CFRunLoopDoSources0 + 218
5 CoreFoundation 0x2631d294 __CFRunLoopRun + 764
6 CoreFoundation 0x2626adac CFRunLoopRunSpecific + 472
7 CoreFoundation 0x2626abbe CFRunLoopRunInMode + 102
8 GraphicsServices 0x2d5dc04c GSEventRunModal + 132
9 UIKit 0x29836a2c UIApplicationMain + 1436
10 Xavier 0x000c85c4 0x6c000 + 378308
11 Xavier 0x000c8720 0x6c000 + 378656
12 libdyld.dylib 0x34463aac start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x345152c8 kevent64 + 24
1 libdispatch.dylib 0x34437ec4 _dispatch_mgr_invoke + 276
2 libdispatch.dylib 0x34437bf6 _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2 name: com.apple.CFSocket.private
Thread 2:
0 libsystem_kernel.dylib 0x3452908c __select + 20
1 CoreFoundation 0x2632354e __CFSocketManager + 486
2 libsystem_pthread.dylib 0x345a7e64 _pthread_body + 136
3 libsystem_pthread.dylib 0x345a7dd6 _pthread_start + 114
4 libsystem_pthread.dylib 0x345a5b80 thread_start + 4
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x34515518 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3451530c mach_msg + 36
2 CoreFoundation 0x2631edc6 __CFRunLoopServiceMachPort + 142
3 CoreFoundation 0x2631d38c __CFRunLoopRun + 1012
4 CoreFoundation 0x2626adac CFRunLoopRunSpecific + 472
5 CoreFoundation 0x2626abbe CFRunLoopRunInMode + 102
6 CFNetwork 0x25e231fa +[NSURLConnection(Loader) _resourceLoadLoop:] + 482
7 Foundation 0x270671b6 __NSThread__main__ + 1114
8 libsystem_pthread.dylib 0x345a7e64 _pthread_body + 136
9 libsystem_pthread.dylib 0x345a7dd6 _pthread_start + 114
10 libsystem_pthread.dylib 0x345a5b80 thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x34515518 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3451530c mach_msg + 36
2 CoreFoundation 0x2631edc6 __CFRunLoopServiceMachPort + 142
3 CoreFoundation 0x2631d38c __CFRunLoopRun + 1012
4 CoreFoundation 0x2626adac CFRunLoopRunSpecific + 472
5 CoreFoundation 0x262b46c6 CFRunLoopRun + 94
6 CoreMotion 0x26b6bb7a 0x26b2d000 + 256890
7 libsystem_pthread.dylib 0x345a7e64 _pthread_body + 136
8 libsystem_pthread.dylib 0x345a7dd6 _pthread_start + 114
9 libsystem_pthread.dylib 0x345a5b80 thread_start + 4
Thread 5 name: Dispatch queue: com.apple.MCSession.callbackQueue
Thread 5 Crashed:
0 libswiftCore.dylib 0x0049b69c 0x304000 + 1668764
1 Xavier 0x000d4af8 0x6c000 + 428792
2 Xavier 0x000d5008 0x6c000 + 430088
3 MultipeerConnectivity 0x2824ba26 __58-[MCSession syncHandleNetworkEvent:pid:freeEventWhenDone:]_block_invoke617 + 114
4 libdispatch.dylib 0x34428610 _dispatch_call_block_and_release + 8
5 libdispatch.dylib 0x34432714 _dispatch_queue_drain$VARIANT$mp + 944
6 libdispatch.dylib 0x344321e4 _dispatch_queue_invoke$VARIANT$mp + 80
7 libdispatch.dylib 0x34434156 _dispatch_root_queue_drain + 310
8 libdispatch.dylib 0x3443527a _dispatch_worker_thread3 + 102
9 libsystem_pthread.dylib 0x345a5e22 _pthread_wqthread + 666
10 libsystem_pthread.dylib 0x345a5b74 start_wqthread + 4
Thread 6:
0 libsystem_kernel.dylib 0x345299cc __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x345a5e9c _pthread_wqthread + 788
2 libsystem_pthread.dylib 0x345a5b74 start_wqthread + 4
Thread 7:
0 libsystem_kernel.dylib 0x345299cc __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x345a5e9c _pthread_wqthread + 788
2 libsystem_pthread.dylib 0x345a5b74 start_wqthread + 4
Thread 8:
0 libsystem_kernel.dylib 0x345299cc __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x345a5e9c _pthread_wqthread + 788
2 libsystem_pthread.dylib 0x345a5b74 start_wqthread + 4
Thread 9:
0 libsystem_kernel.dylib 0x345299cc __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x345a5e9c _pthread_wqthread + 788
2 libsystem_pthread.dylib 0x345a5b74 start_wqthread + 4
Thread 10 name: com.apple.gamekitservices.gcksession.recvproc
Thread 10:
0 libsystem_kernel.dylib 0x3452908c __select + 20
1 MultipeerConnectivity 0x2825f8cc gckSessionRecvProc + 5252
2 libsystem_pthread.dylib 0x345a7e64 _pthread_body + 136
3 libsystem_pthread.dylib 0x345a7dd6 _pthread_start + 114
4 libsystem_pthread.dylib 0x345a5b80 thread_start + 4
Thread 11 name: com.apple.gamekitservices.gcksession.sendproc
Thread 11:
0 libsystem_kernel.dylib 0x3452908c __select + 20
1 MultipeerConnectivity 0x2825fe68 gckSessionSendProc + 268
2 libsystem_pthread.dylib 0x345a7e64 _pthread_body + 136
3 libsystem_pthread.dylib 0x345a7dd6 _pthread_start + 114
4 libsystem_pthread.dylib 0x345a5b80 thread_start + 4
Thread 12 name: com.apple.gamekitservices.eventcallback.eventcbproc
Thread 12:
0 libsystem_kernel.dylib 0x34528b38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x345a73dc _pthread_cond_wait + 516
2 libsystem_pthread.dylib 0x345a82ac pthread_cond_wait + 36
3 MultipeerConnectivity 0x28279a4c EventCBProc + 76
4 libsystem_pthread.dylib 0x345a7e64 _pthread_body + 136
5 libsystem_pthread.dylib 0x345a7dd6 _pthread_start + 114
6 libsystem_pthread.dylib 0x345a5b80 thread_start + 4
Thread 13:
0 libsystem_kernel.dylib 0x34528b38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x345a7416 _pthread_cond_wait + 574
2 libsystem_pthread.dylib 0x345a71d0 pthread_cond_timedwait_relative_np + 12
3 MultipeerConnectivity 0x2825de5c gckSessionRecvUDPPacketWithTimeout + 252
4 ICE 0x2d297234 ICERecvUDPPacketWithTimeout + 340
5 ICE 0x2d29eed2 RecvAndProcess + 310
6 ICE 0x2d2a2d1e ConnectivityCheckProc + 894
7 libsystem_pthread.dylib 0x345a7e64 _pthread_body + 136
8 libsystem_pthread.dylib 0x345a7dd6 _pthread_start + 114
9 libsystem_pthread.dylib 0x345a5b80 thread_start + 4
Thread 5 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x29f6be18 r2: 0x34e7b7e4 r3: 0x00000000
r4: 0x17de21f0 r5: 0x2d34620a r6: 0x17de60d0 r7: 0x00852bc8
r8: 0x17de60d0 r9: 0x18a6a4c0 r10: 0x36c40660 r11: 0x00000000
ip: 0x33ee2531 sp: 0x00852bc4 lr: 0x33ee25c3 pc: 0x0049b69c
cpsr: 0x60000030
My breakpoint hits this line before it crashes:
let rootVC: UINavigationController = UIApplication.sharedApplication().keyWindow.rootViewController as UINavigationController
Following is the whole method that contains this line:
func session(session: MCSession!, didReceiveData data: NSData!, fromPeer peerID: MCPeerID!) {
//Check to see what kind of data is received
var dataReceived:AnyObject = NSKeyedUnarchiver.unarchiveObjectWithData(data)!;
if let newData = dataReceived as? String {
let rootVC: UINavigationController = UIApplication.sharedApplication().keyWindow.rootViewController as UINavigationController;
let topVC = rootVC.topViewController;
if let block = self.commandResolver[newData] {
block(topVC);
return;
} else {
println("Command resolver returns nil block");
}
} else if let newData = dataReceived as? NSDictionary {
let rootVC: UINavigationController = UIApplication.sharedApplication().keyWindow.rootViewController as UINavigationController;
let topVC = rootVC.topViewController as ViewController;
topVC.connected(true, withGroupName: newData["GroupName"] as String!);
} else {
println("Data is not a String");
}
}
My window.rootViewController is UINavigationController so it should not be nil if that is the problem. Can it be though?
I would really appreciate your help guys.

It's crashing in a background thread inside this block:
3 MultipeerConnectivity 0x2824ba26 __58-[MCSession syncHandleNetworkEvent:pid:freeEventWhenDone:]_block_invoke617 + 114
UIKit is generally not thread-safe and is "Main Thread only", so the fact that calling UIApplication.sharedApplication().keyWindow.rootViewController from a background thread crashes is not surprising. You probably want to dispatch this whole block back to the main thread.

Related

NSUserDefaults integerForKey EXC_BAD_ACCESS?

I'm using NSUserDefaults in my application. I received quite a lot crash reports with code that crashes on
[[NSUserDefaults standardUserDefaults] integerForKey:MY_KEY];
with EXC_BAD_ACCESS.
Constants are defined in separate .h header files.
static NSString *const MY_KEY = #"myKey";
static NSInteger const SOME_VALUE = 0;
Part of controller method that crashes
- (void)displayData:(NSInteger)param {
NSString *string1;
NSString *string2;
NSInteger value = [[NSUserDefaults standardUserDefaults] integerForKey: MY_KEY];
}
This is the crash report in Xcode Organizer
This is the crash log
Incident Identifier: 1DD7D3CD-DE9B-4623-AB02-06D2365728DA
CrashReporter Key: 020e241bb4242d3e055b3eef0f3ab86f54af59df
Hardware Model: iPhone6,2
Process: My App [194]
Path: /private/var/mobile/Containers/Bundle/Application/31286A32-F4D3-48E1-8B05-ECE119EA96A8/MyApp.app/My App
Identifier: com.mycompany.myapp
Version: 1.0.0 (1.0.0)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2016-01-16 12:55:34.34 +0200
Launch Time: 2016-01-16 12:24:31.31 +0200
OS Version: iOS 9.2 (13C75)
Report Version: 105
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000158b6560
Triggered by Thread: 0
Filtered syslog:
None found
Global Trace Buffer (reverse chronological seconds):
1.629540 CFNetwork 0x00000001851af104 TCP Conn 0x15a473640 complete. fd: 8, err: 0
1.629540 CFNetwork 0x00000001851b0630 TCP Conn 0x15a473640 event 1. err: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x00000001841b5bd0 objc_msgSend + 16
1 CoreFoundation 0x0000000184b69118 __CFBasicHashAddValue + 328
2 CoreFoundation 0x0000000184a179d8 CFBasicHashAddValue + 288
3 CoreFoundation 0x0000000184a18c90 CFDictionaryAddValue + 248
4 CoreFoundation 0x0000000184a305a8 __CFDictionaryApplyFunction_block_invoke + 24
5 CoreFoundation 0x0000000184a189bc CFBasicHashApply + 128
6 CoreFoundation 0x0000000184a21d3c CFDictionaryApplyFunction + 200
7 CoreFoundation 0x0000000184abd8a8 -[CFPrefsPlistSource mergeIntoDictionary:] + 304
8 CoreFoundation 0x0000000184ae45e0 -[CFPrefsSearchListSource alreadylocked_copyDictionary] + 828
9 CoreFoundation 0x0000000184ae33fc -[CFPrefsSearchListSource alreadylocked_copyValueForKey:] + 72
10 CoreFoundation 0x0000000184b74ee4 ___CFPreferencesCopyAppValueWithContainer_block_invoke + 68
11 CoreFoundation 0x0000000184ae25b8 +[CFPrefsSearchListSource withSearchListForIdentifier:container:perform:] + 572
12 CoreFoundation 0x0000000184b74e5c _CFPreferencesCopyAppValueWithContainer + 188
13 CoreFoundation 0x0000000184b75130 _CFPreferencesGetAppIntegerValueWithContainer + 28
14 My App 0x000000010006f520 -[MyController displayData:] (MyController.m:998)
15 Foundation 0x0000000185425844 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 988
16 Foundation 0x00000001854296a0 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 144
17 My App 0x000000010006cd68 -[MyController StateDidChange:] (MyController.m:307)
18 Foundation 0x00000001854f7e20 __NSThreadPerformPerform + 340
19 CoreFoundation 0x0000000184aecefc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
20 CoreFoundation 0x0000000184aec990 __CFRunLoopDoSources0 + 540
21 CoreFoundation 0x0000000184aea690 __CFRunLoopRun + 724
22 CoreFoundation 0x0000000184a19680 CFRunLoopRunSpecific + 384
23 GraphicsServices 0x0000000185f28088 GSEventRunModal + 180
24 UIKit 0x0000000189890d90 UIApplicationMain + 204
25 My App 0x000000010006b6b4 main (main.m:16)
26 libdyld.dylib 0x00000001845ba8b8 start + 4
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x00000001846d94fc kevent_qos + 8
1 libdispatch.dylib 0x000000018459c94c _dispatch_mgr_invoke + 232
2 libdispatch.dylib 0x000000018458b7bc _dispatch_source_invoke + 0
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x00000001846bd4bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001846bd338 mach_msg + 72
2 CoreFoundation 0x0000000184aecac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x0000000184aea7c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x0000000184a19680 CFRunLoopRunSpecific + 384
5 CFNetwork 0x0000000185189434 +[NSURLConnection(Loader) _resourceLoadLoop:] + 412
6 Foundation 0x00000001854f7c40 __NSThread__start__ + 1000
7 libsystem_pthread.dylib 0x000000018479fb28 _pthread_body + 156
8 libsystem_pthread.dylib 0x000000018479fa8c _pthread_body + 0
9 libsystem_pthread.dylib 0x000000018479d028 thread_start + 4
Thread 3 name: com.apple.CFSocket.private
Thread 3:
0 libsystem_kernel.dylib 0x00000001846d8368 __select + 8
1 CoreFoundation 0x0000000184af3028 __CFSocketManager + 648
2 libsystem_pthread.dylib 0x000000018479fb28 _pthread_body + 156
3 libsystem_pthread.dylib 0x000000018479fa8c _pthread_body + 0
4 libsystem_pthread.dylib 0x000000018479d028 thread_start + 4
Thread 4 name: NetworkLoad
Thread 4:
0 libsystem_kernel.dylib 0x00000001846bd4bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001846bd338 mach_msg + 72
2 CoreFoundation 0x0000000184aecac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x0000000184aea7c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x0000000184a19680 CFRunLoopRunSpecific + 384
5 GeoServices 0x000000018b1e9b5c _runNetworkThread + 428
6 libsystem_pthread.dylib 0x000000018479fb28 _pthread_body + 156
7 libsystem_pthread.dylib 0x000000018479fa8c _pthread_body + 0
8 libsystem_pthread.dylib 0x000000018479d028 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x00000001846d8b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018479d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000018479d020 start_wqthread + 4
Thread 6:
0 libsystem_kernel.dylib 0x00000001846d8b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018479d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000018479d020 start_wqthread + 4
Thread 7:
0 libsystem_kernel.dylib 0x00000001846d8b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018479d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000018479d020 start_wqthread + 4
Thread 8:
0 libsystem_kernel.dylib 0x00000001846d8b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018479d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000018479d020 start_wqthread + 4
Thread 9:
0 libsystem_kernel.dylib 0x00000001846d7f48 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x000000018479ece8 _pthread_cond_wait + 648
2 Foundation 0x0000000185462bac -[NSCondition wait] + 240
3 Foundation 0x0000000185425780 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 792
4 Foundation 0x00000001854296a0 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 144
5 My App 0x0000000100085714 -[AppStateManager HandleAsynchRequest:] (AppStateManager.m:328)
6 Foundation 0x00000001854f7c40 __NSThread__start__ + 1000
7 libsystem_pthread.dylib 0x000000018479fb28 _pthread_body + 156
8 libsystem_pthread.dylib 0x000000018479fa8c _pthread_body + 0
9 libsystem_pthread.dylib 0x000000018479d028 thread_start + 4
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000155616b10 x1: 0x000000018a206102 x2: 0x00000001556169c0 x3: 0x0000000155616b10
x4: 0x000000015680c2c0 x5: 0x0000000000000010 x6: 0x0000000000000067 x7: 0x0000000000000fd0
x8: 0x00000001a1223000 x9: 0x00000000158b6550 x10: 0x00000001a216a000 x11: 0x00000001a216a000
x12: 0x00000001556169d0 x13: 0x10000000158b6554 x14: 0x000000000000008c x15: 0x00000001556169dd
x16: 0x5000f8d3b4fb11e2 x17: 0x00000001556169dd x18: 0x0000000000000000 x19: 0x000000015680c240
x20: 0x00000001556169c0 x21: 0x0000000155616b10 x22: 0x0000000000000001 x23: 0x00000001a2165360
x24: 0x0000000184aee6c8 x25: 0x00000001a2165360 x26: 0x0000000000000003 x27: 0x0000000158ffa300
x28: 0x00000000a7baadb1 fp: 0x000000016fd99f50 lr: 0x0000000184b69118
sp: 0x000000016fd99f00 pc: 0x00000001841b5bd0 cpsr: 0x20000000
I'm getting this message with zombies enabled
[CFString retain]: message sent to deallocated instance 0x12f78f7e0
I replicated this bug once on my development iPhone. Also note that the application uses real-time TCP communication. When I receive some data a block is created to show the data in the UI.
Can NSUserDefaults produce a EXC_BAD_ACCESS?
It's an issue related to memory leaks. To solve the problem use Xcode static analysis to find potential memory leaks in the code. Also run Xcode instruments with Leaks configuration.

EXC_BAD_ACCESS (SIGSEGV) and KERN_INVALID_ADDRESS

This issue is getting on my nerves. Please see the crash report and help. In iOS 6 app is working fine. I am performing some operations. After 30 operations are completed I am experiencing this crash. This number can go till 20 also or 1 also. Attaching crash log with this. All the experts please help.
Incident Identifier: E863E717-DE21-4BD0-A203-32E9D4648869
CrashReporter Key: b7fe8726c57b6cc93687be0e904625ecf3813fb9
Hardware Model: iPad2,5
Process: mobile [3833]
Path:
Identifier:
Version:
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-06-01 17:07:33.679 +0530
OS Version: iOS 7.0.6 (11B651)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x1e2d1f28
Triggered by Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x38e79b26 objc_msgSend + 6
1 CoreFoundation 0x2e618650 CFRelease + 552
2 CoreFoundation 0x2e626702 -[__NSDictionaryI dealloc] + 114
3 libobjc.A.dylib 0x38e89b06 objc_object::sidetable_release(bool) + 170
4 libobjc.A.dylib 0x38e7b002 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 354
5 CoreFoundation 0x2e61b97c _CFAutoreleasePoolPop + 12
6 Foundation 0x2f00385c -[NSAutoreleasePool release] + 116
7 CoreFoundation 0x2e6b3180 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
8 CoreFoundation 0x2e6b264e __CFRunLoopDoSources0 + 202
9 CoreFoundation 0x2e6b0e42 __CFRunLoopRun + 618
10 CoreFoundation 0x2e61bc22 CFRunLoopRunSpecific + 518
11 CoreFoundation 0x2e61ba06 CFRunLoopRunInMode + 102
12 Foundation 0x2f0093d6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
13 mobile 0x001704d0 -[VFIPinpad waitForACK] (VFIPinpad.m:2876)
14 mobile 0x00174cd8 -[VFIPinpad sendDataCommand:calcLRC:] (VFIPinpad.m:3716)
15 mobile 0x0017a46a -[VFIPinpad setROSParams:threshold:target:targetPercent:] (VFIPinpad.m:4702)
16 mobile 0x0020d5a4 -[VFIPWLm startTransaction:origAmount:finalAmount:surcharge:invoice:discount:promocode:chequeData:AVSAddress:AVSPostcode:email:refTransactionID:gpsLatitude:gpsLongitude:merchID:terminalID:allowRefundSystemByID:status:statusMsg:tranID:authCode:totalCharge:signatureRequired:voiceAuthPhone:merchantID:tipAmount:receiptData:cardScheme:] (VFIPWLm.m:2840)
17 mobile 0x00064df0 -[MainViewController startTran] (MainViewController.m:1918)
18 mobile 0x00077dac -[MainViewController showView] (MainViewController.m:3359)
19 mobile 0x00084d14 -[MainViewController sc8Next] (MainViewController.m:4674)
20 UIKit 0x30e8f70e -[UIApplication sendAction:to:from:forEvent:] + 86
21 UIKit 0x30e8f6ae -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
22 UIKit 0x30e8f68c -[UIControl sendAction:to:forEvent:] + 40
23 UIKit 0x30e7b11a -[UIControl _sendActionsForEvents:withEvent:] + 370
24 UIKit 0x30e8f102 -[UIControl touchesEnded:withEvent:] + 586
25 UIKit 0x30e8edd4 -[UIWindow _sendTouchesForEvent:] + 524
26 UIKit 0x30e89e60 -[UIWindow sendEvent:] + 828
27 UIKit 0x30e5f798 -[UIApplication sendEvent:] + 192
28 UIKit 0x30e5df9e _UIApplicationHandleEventQueue + 7094
29 CoreFoundation 0x2e6b3180 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
30 CoreFoundation 0x2e6b264e __CFRunLoopDoSources0 + 202
31 CoreFoundation 0x2e6b0e42 __CFRunLoopRun + 618
32 CoreFoundation 0x2e61bc22 CFRunLoopRunSpecific + 518
33 CoreFoundation 0x2e61ba06 CFRunLoopRunInMode + 102
34 GraphicsServices 0x3330f27e GSEventRunModal + 134
35 UIKit 0x30ebf044 UIApplicationMain + 1132
36 mobile 0x00054ae0 main (main.m:16)
37 libdyld.dylib 0x39386ab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x3942a83c kevent64 + 24
1 libdispatch.dylib 0x3936b210 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x3936af96 _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x3942aa8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3942a888 mach_msg + 44
2 CoreFoundation 0x2e6b27be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2e6b0ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2e61bc22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2e61ba06 CFRunLoopRunInMode + 102
6 WebCore 0x36829266 RunWebThread(void*) + 414
7 libsystem_pthread.dylib 0x394a5c1a _pthread_body + 138
8 libsystem_pthread.dylib 0x394a5b8a _pthread_start + 98
9 libsystem_pthread.dylib 0x394a3c8c thread_start + 4
Thread 3:
0 libsystem_kernel.dylib 0x3942aa8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3942a888 mach_msg + 44
2 CoreFoundation 0x2e6b27be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2e6b0ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2e61bc22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2e61ba06 CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2d69e584 GenericRunLoopThread::Entry(void*) + 124
7 libAVFAudio.dylib 0x2d69299c CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x394a5c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x394a5b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x394a3c8c thread_start + 4
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x3943d440 select$DARWIN_EXTSN + 20
1 CoreFoundation 0x2e6b6680 __CFSocketManager + 480
2 libsystem_pthread.dylib 0x394a5c1a _pthread_body + 138
3 libsystem_pthread.dylib 0x394a5b8a _pthread_start + 98
4 libsystem_pthread.dylib 0x394a3c8c thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x3943d440 select$DARWIN_EXTSN + 20
1 ExternalAccessory 0x2eff4352 -[EAInputStream _readInputFromAccThread] + 342
2 Foundation 0x2f0cbc82 __NSThread__main__ + 1058
3 libsystem_pthread.dylib 0x394a5c1a _pthread_body + 138
4 libsystem_pthread.dylib 0x394a5b8a _pthread_start + 98
5 libsystem_pthread.dylib 0x394a3c8c thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x3942aa8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3942a888 mach_msg + 44
2 CoreFoundation 0x2e6b27be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2e6b0ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2e61bc22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2e65f736 CFRunLoopRun + 94
6 CoreMotion 0x2ecd2230 ___lldb_unnamed_function1404$$CoreMotion + 724
7 libsystem_pthread.dylib 0x394a5c1a _pthread_body + 138
8 libsystem_pthread.dylib 0x394a5b8a _pthread_start + 98
9 libsystem_pthread.dylib 0x394a3c8c thread_start + 4
Thread 7:
0 libsystem_kernel.dylib 0x3943dc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x394a3dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x394a3c80 start_wqthread + 4
Thread 8:
0 libsystem_kernel.dylib 0x3943dc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x394a3dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x394a3c80 start_wqthread + 4
Thread 9:
0 libsystem_kernel.dylib 0x3943dc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x394a3dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x394a3c80 start_wqthread + 4
Thread 10:
0 libsystem_kernel.dylib 0x3943dc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x394a3dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x394a3c80 start_wqthread + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x0281f840 r1: 0x31441b29 r2: 0x39647f78 r3: 0x000037f7
r4: 0x559b030e r5: 0x39632010 r6: 0x0281f840 r7: 0x27dde5a8
r8: 0x0281f844 r9: 0x1e2d1f1c r10: 0x16895960 r11: 0x00000000
ip: 0x3961f740 sp: 0x27dde568 lr: 0x2e618655 pc: 0x38e79b26
cpsr: 0x40000030

iOS app crash only if run from instrument (Automation)

My app do not crash on device. No leaks no memory warning. I was living happily. But recently I was doing some UI testing with Instrument(Automation). Boom Boom. App crashes after using it like 8 min. Looping around like 30 times. And it keep crashing but after different durations but all at same step. Again no leaks no memory warning. Again it do not crash on device(without instrument) doesn't matter how long use my app.
+ Every times it crashes after I pop a specific ViewController. And that view controller is loaded with stuffs (image view, playing and recording audio, take photo from album and camera)
Here is the device log. Any kind of help is highly appreciated.
Incident Identifier:
CrashReporter Key:
Hardware Model: iPhone5,2
Process: My App [15196]
Path:
Identifier: My App
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-08-16 12:48:10.814 +0200
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x1208b319
Crashed Thread: 6
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x39be3e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39be3fd0 mach_msg + 48
2 CoreFoundation 0x319da2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x319d8fd6 __CFRunLoopRun + 814
4 CoreFoundation 0x3194c238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3194c0c4 CFRunLoopRunInMode + 100
6 GraphicsServices 0x3552b336 GSEventRunModal + 70
7 UIKit 0x338682b4 UIApplicationMain + 1116
8 MyApp 0x0000531e 0x3000 + 8990
9 MyApp 0x000052d4 0x3000 + 8916
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x39be45d0 kevent64 + 24
1 libdispatch.dylib 0x39b1fd22 _dispatch_mgr_invoke + 806
2 libdispatch.dylib 0x39b1b374 _dispatch_mgr_thread + 32
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x39be3e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39be3fd0 mach_msg + 48
2 CoreFoundation 0x319da2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x319d902c __CFRunLoopRun + 900
4 CoreFoundation 0x3194c238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3194c0c4 CFRunLoopRunInMode + 100
6 WebCore 0x37954390 RunWebThread(void*) + 440
7 libsystem_c.dylib 0x39b4d0de _pthread_start + 306
8 libsystem_c.dylib 0x39b4cfa4 thread_start + 4
Thread 3:
0 libsystem_kernel.dylib 0x39be3e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39be3fd0 mach_msg + 48
2 CoreFoundation 0x319da2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x319d902c __CFRunLoopRun + 900
4 CoreFoundation 0x3194c238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3194c0c4 CFRunLoopRunInMode + 100
6 Foundation 0x322705be -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 MyApp 0x00020b0a 0x3000 + 121610
8 Foundation 0x3231d22c __NSThread__main__ + 968
9 libsystem_c.dylib 0x39b4d0de _pthread_start + 306
10 libsystem_c.dylib 0x39b4cfa4 thread_start + 4
Thread 4 name: com.apple.NSURLConnectionLoader
Thread 4:
0 libsystem_kernel.dylib 0x39be3e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39be3fd0 mach_msg + 48
2 CoreFoundation 0x319da2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x319d902c __CFRunLoopRun + 900
4 CoreFoundation 0x3194c238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3194c0c4 CFRunLoopRunInMode + 100
6 Foundation 0x32299888 +[NSURLConnection(Loader) _resourceLoadLoop:] + 304
7 Foundation 0x3231d22c __NSThread__main__ + 968
8 libsystem_c.dylib 0x39b4d0de _pthread_start + 306
9 libsystem_c.dylib 0x39b4cfa4 thread_start + 4
Thread 5 name: com.apple.CFSocket.private
Thread 5:
0 libsystem_kernel.dylib 0x39bf4594 __select + 20
1 CoreFoundation 0x319de474 __CFSocketManager + 676
2 libsystem_c.dylib 0x39b4d0de _pthread_start + 306
3 libsystem_c.dylib 0x39b4cfa4 thread_start + 4
Thread 6 Crashed:
0 Foundation 0x3231d692 __NSFinalizeThreadData + 122
1 CoreFoundation 0x319d6212 __CFTSDFinalize + 62
2 libsystem_c.dylib 0x39b3feb8 _pthread_tsd_cleanup + 172
3 libsystem_c.dylib 0x39b3fb8e _pthread_exit + 114
4 libsystem_c.dylib 0x39b42ade _pthread_workq_return + 22
5 libsystem_c.dylib 0x39b427f2 _pthread_wqthread + 362
6 libsystem_c.dylib 0x39b42680 start_wqthread + 4
Thread 7:
0 libsystem_kernel.dylib 0x39bf4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x39b42ad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x39b427f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x39b42680 start_wqthread + 4
Thread 8:
0 libsystem_kernel.dylib 0x39bf4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x39b42ad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x39b427f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x39b42680 start_wqthread + 4
Thread 9 name: AURemoteIO::IOThread
Thread 9:
0 libsystem_kernel.dylib 0x39be3e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39be3fd0 mach_msg + 48
2 AudioToolbox 0x314cdc80 AURemoteIO::IOThread::Run() + 104
3 AudioToolbox 0x314d000c AURemoteIO::IOThread::Entry(void*) + 4
4 AudioToolbox 0x3140d9f2 CAPThread::Entry(CAPThread*) + 294
5 libsystem_c.dylib 0x39b4d0de _pthread_start + 306
6 libsystem_c.dylib 0x39b4cfa4 thread_start + 4
Thread 6 crashed with ARM Thread State (32-bit):
r0: 0x0010f522 r1: 0x39700941 r2: 0x39e57e88 r3: 0x1f8dc028
r4: 0x1208b2fd r5: 0x0000001c r6: 0x00000000 r7: 0x04af9f18
r8: 0x1f8dc028 r9: 0x007f8014 r10: 0x00000004 r11: 0x00000037
ip: 0x39d4db30 sp: 0x04af9d50 lr: 0x31946eb7 pc: 0x3231d692
cpsr: 0x20000030
EXC_BAD_ACCESS generally means that you are sending a objective c message to an invalid memory address. This happens because an object that you are using has been deallocated.
Use NSZombieEnabled to get more information.
Start commenting out stuff. It's a memory issue, find the offending line of code.

Cocos2D 2 OSX EXC_BAD_ACCESS (SIGSEGV)

I'm updating a Game I have for the Mac and the update works fine while running through XCode.
I try to Distribute through Developer ID-signed Application so I can have a friend test it and when I run the app and also give them the app it crashes just after the Main Menu. Am I exporting it wrong? Why would it run fine through XCode and then I try to export it and it crashes every time?
Here is my error log:
Crashed Thread: 6 CVDisplayLink
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000121028021
VM Regions Near 0x121028021:
CG shared images 000000011f294000-000000011f29c000 [ 32K] r--/r-- SM=SHM
-->
CG shared images 00000001c0001000-00000001c0009000 [ 32K] rw-/rw- SM=SHM
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff91ef6686 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff91ef5c42 mach_msg + 70
2 com.apple.CoreFoundation 0x00007fff8bf01803 __CFRunLoopServiceMachPort + 195
3 com.apple.CoreFoundation 0x00007fff8bf06ee6 __CFRunLoopRun + 1078
4 com.apple.CoreFoundation 0x00007fff8bf066b2 CFRunLoopRunSpecific + 290
5 com.apple.HIToolbox 0x00007fff943620a4 RunCurrentEventLoopInMode + 209
6 com.apple.HIToolbox 0x00007fff94361e42 ReceiveNextEventCommon + 356
7 com.apple.HIToolbox 0x00007fff94361cd3 BlockUntilNextEventMatchingListInMode + 62
8 com.apple.AppKit 0x00007fff961c8613 _DPSNextEvent + 685
9 com.apple.AppKit 0x00007fff961c7ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
10 com.apple.AppKit 0x00007fff961bf283 -[NSApplication run] + 517
11 com.apple.AppKit 0x00007fff96163cb6 NSApplicationMain + 869
12 libdyld.dylib 0x00007fff916837e1 start + 1
Thread 1:
0 libsystem_kernel.dylib 0x00007fff91ef86d6 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8ce15eec _pthread_workq_return + 25
2 libsystem_c.dylib 0x00007fff8ce15cb3 _pthread_wqthread + 412
3 libsystem_c.dylib 0x00007fff8ce00171 start_wqthread + 13
Thread 2:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff91ef8d16 kevent + 10
1 libdispatch.dylib 0x00007fff91fbfdea _dispatch_mgr_invoke + 883
2 libdispatch.dylib 0x00007fff91fbf9ee _dispatch_mgr_thread + 54
Thread 3:
0 libsystem_kernel.dylib 0x00007fff91ef86d6 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8ce15eec _pthread_workq_return + 25
2 libsystem_c.dylib 0x00007fff8ce15cb3 _pthread_wqthread + 412
3 libsystem_c.dylib 0x00007fff8ce00171 start_wqthread + 13
Thread 4:
0 libsystem_kernel.dylib 0x00007fff91ef86d6 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8ce15eec _pthread_workq_return + 25
2 libsystem_c.dylib 0x00007fff8ce15cb3 _pthread_wqthread + 412
3 libsystem_c.dylib 0x00007fff8ce00171 start_wqthread + 13
Thread 5:
0 libsystem_kernel.dylib 0x00007fff91ef86d6 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8ce15eec _pthread_workq_return + 25
2 libsystem_c.dylib 0x00007fff8ce15cb3 _pthread_wqthread + 412
3 libsystem_c.dylib 0x00007fff8ce00171 start_wqthread + 13
Thread 6 Crashed:: CVDisplayLink
0 com.lasthaven.wordshufflemac 0x000000010bacc52a -[GameScene scrambleWord:] + 158 (GameScene.m:322)
1 com.lasthaven.wordshufflemac 0x000000010baced36 -[GameScene setupNewWord] + 373 (GameScene.m:878)
2 com.lasthaven.wordshufflemac 0x000000010bacb6c1 -[GameScene initializeGame] + 941 (GameScene.m:112)
3 com.lasthaven.wordshufflemac 0x000000010bacb2fc -[GameScene init] + 428 (GameScene.m:56)
4 com.lasthaven.wordshufflemac 0x000000010baf30c1 +[CCNode node] + 33
5 com.lasthaven.wordshufflemac 0x000000010bacb11b +[GameScene scene] + 62 (GameScene.m:32)
6 com.lasthaven.wordshufflemac 0x000000010bac9f90 -[MenuScene playGame:] + 363 (MenuScene.m:301)
7 com.lasthaven.wordshufflemac 0x000000010baee7e3 -[CCMenu ccMouseUp:] + 112
8 com.lasthaven.wordshufflemac 0x000000010bb177fb -[CCEventDispatcher mouseUp:] + 101
9 com.apple.Foundation 0x00007fff97fa5220 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 212
10 com.apple.Foundation 0x00007fff97fdf8b9 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:] + 122
11 com.lasthaven.wordshufflemac 0x000000010bb17f25 -[CCEventDispatcher dispatchEvent:] + 140
12 com.apple.Foundation 0x00007fff97fab677 __NSThreadPerformPerform + 225
13 com.apple.CoreFoundation 0x00007fff8bee4101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 com.apple.CoreFoundation 0x00007fff8bee3a25 __CFRunLoopDoSources0 + 245
15 com.apple.CoreFoundation 0x00007fff8bf06dc5 __CFRunLoopRun + 789
16 com.apple.CoreFoundation 0x00007fff8bf066b2 CFRunLoopRunSpecific + 290
17 com.apple.Foundation 0x00007fff97fb389e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 268
18 com.lasthaven.wordshufflemac 0x000000010bb16888 -[CCDirectorDisplayLink getFrameForTime:] + 162
19 com.apple.CoreVideo 0x00007fff8c0c603d CVDisplayLink::performIO(CVTimeStamp*) + 203
20 com.apple.CoreVideo 0x00007fff8c0c52a4 CVDisplayLink::runIOThread() + 632
21 com.apple.CoreVideo 0x00007fff8c0c5013 startIOThread(void*) + 148
22 libsystem_c.dylib 0x00007fff8ce13742 _pthread_start + 327
23 libsystem_c.dylib 0x00007fff8ce00181 thread_start + 13
scratch that.
after staring at this line for hours:
0 com.lasthaven.wordshufflemac 0x000000010bacc52a -[GameScene scrambleWord:] + 158 (GameScene.m:322)
I realized that the code consisted of a for loop and I couldn't figure out what was wrong with it! So in the end I forgot to initialize the int i in beginning of the for loop.
for(int i = 0; i < [word length]; i++ {
}
So for something so simple that caused a crash outside of XCode but not within it drove me nuts!
Thanks for reading!

Using blocks causes EXC_BAD_ACCESS

I'd like to use blocks, but it causes me a EXC_BAD_ACCESS after a few calls.
My code:
- (void) sendBasket {
if (currentSendToBasketBlock != nil) {
// there's already a webservice going... set the new one as waiting
waitingSendToBasketBlock = ^ {
WebServicesModel *webServicesModel = [[[WebServicesModel alloc] init] autorelease];
webServicesModel.delegate = self;
[webServicesModel sendBasketToServer:currentBasket];
[self showBasketBackground];
};
[waitingSendToBasketBlock copy];
} else {
currentSendToBasketBlock = ^ {
WebServicesModel *webServicesModel = [[[WebServicesModel alloc] init] autorelease];
webServicesModel.delegate = self;
[webServicesModel sendBasketToServer:currentBasket];
[self showBasketBackground];
};
[currentSendToBasketBlock copy];
currentSendToBasketBlock();
}
}
When the webservice is finished, it calls a specific method on the same object:
- (void) specificMethod {
if (waitingSendToBasketBlock != nil) {
waitingSendToBasketBlock(); // here, the EXC_BAD_ACCESS happens
waitingSendToBasketBlock = nil;
}
}
What am I missing? Instruments doesn't find a Zombie...
Thanks!
Edit: Crash Log
Thread 0 name: Dispatch queue: com.apple.libdispatch-manager
Thread 0:
0 libsystem_kernel.dylib 0x35590fbc kevent + 24
1 libdispatch.dylib 0x3525bed4 _dispatch_mgr_invoke + 744
2 libdispatch.dylib 0x3525cf3a _dispatch_queue_invoke + 70
3 libdispatch.dylib 0x3525c4ec _dispatch_worker_thread2 + 228
4 libsystem_c.dylib 0x3566758a _pthread_wqthread + 258
5 libsystem_c.dylib 0x35667bbc start_wqthread + 0
Thread 1 name: WebThread
Thread 1:
0 libsystem_kernel.dylib 0x3558dc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3558d758 mach_msg + 44
2 CoreFoundation 0x309582b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3095a562 __CFRunLoopRun + 350
4 CoreFoundation 0x308eaebc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x308eadc4 CFRunLoopRunInMode + 52
6 WebCore 0x35f5327e _ZL12RunWebThreadPv + 382
7 libsystem_c.dylib 0x3566630a _pthread_start + 242
8 libsystem_c.dylib 0x35667bb4 thread_start + 0
Thread 2:
0 libsystem_kernel.dylib 0x35591cb0 stat + 12
1 CFNetwork 0x34cccf56 DiskCookieStorage::syncStorageLocked() + 422
2 CFNetwork 0x34c3fa60 PrivateHTTPCookieStorage::syncStorage() + 20
3 CFNetwork 0x34ccaa7e HTTPCookieStorage::syncStorage() + 6
4 CFNetwork 0x34ccaa9c HTTPCookieStorage::_syncTimerFired(__CFRunLoopTimer*, void*) + 12
5 CoreFoundation 0x30957a40 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
6 CoreFoundation 0x30959ec4 __CFRunLoopDoTimer + 844
7 CoreFoundation 0x3095a83e __CFRunLoopRun + 1082
8 CoreFoundation 0x308eaebc CFRunLoopRunSpecific + 224
9 CoreFoundation 0x308eadc4 CFRunLoopRunInMode + 52
10 Foundation 0x341dd7f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
11 Foundation 0x341d0382 -[NSThread main] + 38
12 Foundation 0x342425c6 __NSThread__main__ + 966
13 libsystem_c.dylib 0x3566630a _pthread_start + 242
14 libsystem_c.dylib 0x35667bb4 thread_start + 0
Thread 3 name: com.apple.CFSocket.private
Thread 3:
0 libsystem_kernel.dylib 0x3558fc60 __select + 20
1 CoreFoundation 0x3095d8f2 __CFSocketManager + 582
2 libsystem_c.dylib 0x3566630a _pthread_start + 242
3 libsystem_c.dylib 0x35667bb4 thread_start + 0
Thread 4:
0 libsystem_kernel.dylib 0x3558dc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3558d758 mach_msg + 44
2 CoreFoundation 0x309582b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3095a562 __CFRunLoopRun + 350
4 CoreFoundation 0x308eaebc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x3092d6d2 CFRunLoopRun + 42
6 MyProject 0x0011c41a +[ASIHTTPRequest runRequests] (ASIHTTPRequest.m:4773)
7 Foundation 0x341d0382 -[NSThread main] + 38
8 Foundation 0x342425c6 __NSThread__main__ + 966
9 libsystem_c.dylib 0x3566630a _pthread_start + 242
10 libsystem_c.dylib 0x35667bb4 thread_start + 0
Thread 5:
0 libsystem_kernel.dylib 0x355903ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x356676d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x35667bbc start_wqthread + 0
Thread 6:
0 libsystem_kernel.dylib 0x355903ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x356676d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x35667bbc start_wqthread + 0
Thread 7:
0 libsystem_kernel.dylib 0x355903ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x356676d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x35667bbc start_wqthread + 0
You are not doing anything with your copy, therefore you are still attempting to access the block that was stored on the stack. Try this in the place of your call to copy.
waitingSendToBasketBlock = Block_copy(waitingSendToBasketBlock);
//and
currentSendToBasketBlock = Block_copy(currentSendToBasketBlock);