NSTextField binding causes EXC_BAD_ACCESS - objective-c

I have an NSTextField which is bound to an int in an object that I have included in my nib. When the object changes its int, the text field follows suit, and everything looks fine.
However, when I try to change it manually the program crashes as soon as I hit a key. It's not even getting into my setter methods, it just crashes with
Program received signal: “EXC_BAD_ACCESS”.
It's not even in any of my code... presumably, I made the binding wrong, but what could I have done that would make it segfault like that?
ETA: stackframes from a crash:
Process: DocKeep [77998]
Path: /Users/acordex/Documents/projects/DocKeep/build/Debug/DocKeep.app/Contents/MacOS/DocKeep
Identifier: com.acordex.DocKeep
Version: 9.00 pre-Alpha (9.00 pre-Alpha)
Code Type: X86 (Native)
Parent Process: Instruments [77954]
Date/Time: 2010-07-29 10:01:11.927 -0400
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000001c
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 com.apple.AppKit 0x954a4734 -[NSDocument(NSEditorRegistration) _isBeingEdited] + 24
1 com.apple.AppKit 0x954a4707 -[NSDocument isDocumentEdited] + 47
2 com.apple.AppKit 0x955b3900 -[NSDocument(NSEditorRegistration) objectDidBeginEditing:] + 48
3 com.apple.AppKit 0x95461ef9 -[NSValueBinder _startChanging] + 126
4 com.apple.AppKit 0x95461dc1 -[NSTextValueBinder _startChanging] + 60
5 com.apple.AppKit 0x95461d5f -[_NSBindingAdaptor _editor:didChangeEditingState:bindingAdaptor:] + 181
6 com.apple.AppKit 0x95461c9f -[_NSBindingAdaptor editorDidBeginEditing:] + 278
7 com.apple.AppKit 0x95442e5a -[NSTextField textShouldBeginEditing:] + 239
8 com.apple.AppKit 0x95441d0b -[NSTextView(NSSharing) shouldChangeTextInRanges:replacementStrings:] + 573
9 com.apple.AppKit 0x95464563 _NSDoUserReplaceForCharRange + 191
10 com.apple.AppKit 0x9546449e _NSDoUserDeleteForCharRange + 79
11 com.apple.AppKit 0x95463b07 -[NSTextView(NSKeyBindingCommands) deleteBackward:] + 684
12 com.apple.AppKit 0x9544b364 -[NSResponder doCommandBySelector:] + 77
13 com.apple.AppKit 0x9544ac7f -[NSTextView doCommandBySelector:] + 240
14 com.apple.AppKit 0x95439bbf -[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCommand:forClient:] + 1911
15 com.apple.AppKit 0x9543d44f -[NSTextInputContext handleEvent:] + 1604
16 com.apple.AppKit 0x95439229 -[NSView interpretKeyEvents:] + 209
17 com.apple.AppKit 0x9543ccd5 -[NSTextView keyDown:] + 751
18 com.apple.AppKit 0x9536df6c -[NSWindow sendEvent:] + 5757
19 com.apple.AppKit 0x95286aff -[NSApplication sendEvent:] + 6431
20 com.apple.AppKit 0x9521a5bb -[NSApplication run] + 917
21 com.apple.AppKit 0x952125ed NSApplicationMain + 574
22 com.acordex.DocKeep 0x0000224c main + 30 (main.m:14)
23 com.acordex.DocKeep 0x00002202 start + 54
Thread 1:
0 libSystem.B.dylib 0x94a319d2 __workq_kernreturn + 10
1 libSystem.B.dylib 0x94a31f68 _pthread_wqthread + 941
2 libSystem.B.dylib 0x94a31b86 start_wqthread + 30
Thread 2: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x94a32942 kevent + 10
1 libSystem.B.dylib 0x94a3305c _dispatch_mgr_invoke + 215
2 libSystem.B.dylib 0x94a32519 _dispatch_queue_invoke + 163
3 libSystem.B.dylib 0x94a322be _dispatch_worker_thread2 + 240
4 libSystem.B.dylib 0x94a31d41 _pthread_wqthread + 390
5 libSystem.B.dylib 0x94a31b86 start_wqthread + 30
Thread 3:
0 libSystem.B.dylib 0x94a3a066 __semwait_signal + 10
1 libSystem.B.dylib 0x94a39d22 _pthread_cond_wait + 1191
2 libSystem.B.dylib 0x94a3b9b8 pthread_cond_wait$UNIX2003 + 73
3 com.apple.CoreVideo 0x96730c3e CVDisplayLink::runIOThread() + 1016
4 com.apple.CoreVideo 0x9673082a startIOThread(void*) + 156
5 libSystem.B.dylib 0x94a3981d _pthread_start + 345
6 libSystem.B.dylib 0x94a396a2 thread_start + 34
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000000 ebx: 0x954a472d ecx: 0x00000001 edx: 0x00000000
edi: 0x0045f650 esi: 0x0045f650 ebp: 0xbfffe738 esp: 0xbfffe720
ss: 0x0000001f efl: 0x00010282 eip: 0x954a4734 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x0000001c
I DO have a document class that is subclassed off of NSDocument, and the textfield IS bound to a field of that document object, but I'm not sure why that would matter.

The environment variable NSBindingDebugLogLevel might be useful. Set it and check your logs carefully for warnings. You might not see the warning if you have a breakpoint set on NSException raise.
Bindings should work with an int, definitely not with an unsigned int. But NSTextfield requires an NSString, or at least an NSNumber and an associated NSNumberFormatter.

Related

Objective c dispatch_async crash

code :
- (void)stopCurrentSessionFromSuite:(NSNotification*)notification{
isCloseCurrentSession = YES;
dispatch_async(self.dataSendingQueue, ^{
CARD8 messageToDisableSession = rpcHostDisableMsg;
[readerNwriter writeExact:(char*)&messageToDisableSession ofLenght:sizeof(CARD8) secApplied:NO];
});
[rpcCaptureMgr stopCaptureSession];
}
Crash :
Time Awake Since Boot: 1400 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at 0x0000000000000070 Exception Note:
EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11 Termination Reason:
Namespace SIGNAL, Code 0xb Terminating Process: exc handler [0]
VM Regions Near 0x70:
-->
__TEXT 000000010871a000-000000010873a000 [ 128K] r-x/rwx SM=COW
/Applications/RemotePCSuite/*/RemotePCDesktop.app/Contents/MacOS/RemotePCDesktop
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0
libdispatch.dylib 0x00007fff72de50db
_dispatch_continuation_async + 5 1 com.prosoftnet.remotepcDesktop 0x0000000108727fd5
-[RPCDesktopAppDelegate stopCurrentSessionFromSuite:] + 104 2 com.apple.CoreFoundation 0x00007fff4b7a333c
CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12 3 com.apple.CoreFoundation 0x00007fff4b7a32cf
_CFXRegistrationPost_block_invoke + 63 4 com.apple.CoreFoundation 0x00007fff4b7ab92c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 5
com.apple.CoreFoundation 0x00007fff4b78e8a3 __CFRunLoopDoBlocks
+ 275 6 com.apple.CoreFoundation 0x00007fff4b78e668 __CFRunLoopRun + 3128 7 com.apple.CoreFoundation 0x00007fff4b78d797 CFRunLoopRunSpecific + 487 8 com.apple.HIToolbox
0x00007fff4aaa2866 RunCurrentEventLoopInMode + 286 9
com.apple.HIToolbox 0x00007fff4aaa25d6
ReceiveNextEventCommon + 613 10 com.apple.HIToolbox
0x00007fff4aaa2354 _BlockUntilNextEventMatchingListInModeWithFilter +
64 11 com.apple.AppKit 0x00007fff48d9fa23 _DPSNextEvent
+ 2085 12 com.apple.AppKit 0x00007fff49534e6c -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044 13 com.apple.AppKit 0x00007fff48d94831 -[NSApplication run]
+ 764 14 com.apple.AppKit 0x00007fff48d639d2 NSApplicationMain + 804 15 libdyld.dylib
0x00007fff72e0c145 start + 1

Why did IntelliJ IDEA crash?

My IntelliJ IDEA's Version is 15.0.6 (IU-143.2370.31)
It always crashes when I use it.
Here is the snippet of the problem report
Process: idea [7902]
Path: /Applications/IntelliJ IDEA 15.app/Contents/MacOS/idea
Identifier: com.jetbrains.intellij
Version: 15.0.6 (IU-143.2370.31)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: idea [7902]
User ID: 501
Date/Time: 2016-07-18 19:11:13.744 +0800
OS Version: Mac OS X 10.11.5 (15F34)
Report Version: 11
Anonymous UUID: F89C4D90-6E24-6839-A0EC-646466E39AF6
Sleep/Wake UUID: 483379D4-51BE-4BC7-9DAA-912784CD219D
Time Awake Since Boot: 68000 seconds
Time Since Wake: 37000 seconds
System Integrity Protection: enabled
Crashed Thread: 18 Java: Java2D Queue Flusher
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
abort() called
Thread 0:: AppKit Thread Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff9ab45f72 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff9ab453b3 mach_msg + 55
2 com.apple.CoreFoundation 0x00007fff8b8e51c4 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fff8b8e468c __CFRunLoopRun + 1356
4 com.apple.CoreFoundation 0x00007fff8b8e3ed8 CFRunLoopRunSpecific + 296
5 com.apple.HIToolbox 0x00007fff9befc935 RunCurrentEventLoopInMode + 235
6 com.apple.HIToolbox 0x00007fff9befc76f ReceiveNextEventCommon + 432
7 com.apple.HIToolbox 0x00007fff9befc5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
8 com.apple.AppKit 0x00007fff8bd1adf6 _DPSNextEvent + 1067
9 com.apple.AppKit 0x00007fff8bd1a226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
10 libosxapp.dylib 0x000000012c0c54e3 -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
11 com.apple.AppKit 0x00007fff8bd0ed80 -[NSApplication run] + 682
12 libosxapp.dylib 0x000000012c0c5346 +[NSApplicationAWT runAWTLoopWithApp:] + 156
13 liblwawt.dylib 0x000000012cac617d -[AWTStarter starter:] + 873
14 com.apple.Foundation 0x00007fff9cf15fde __NSThreadPerformPerform + 279
15 com.apple.CoreFoundation 0x00007fff8b905881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
16 com.apple.CoreFoundation 0x00007fff8b8e4fbc __CFRunLoopDoSources0 + 556
17 com.apple.CoreFoundation 0x00007fff8b8e44df __CFRunLoopRun + 927
18 com.apple.CoreFoundation 0x00007fff8b8e3ed8 CFRunLoopRunSpecific + 296
19 com.jetbrains.intellij 0x00000001000013bf main + 357
20 com.jetbrains.intellij 0x0000000100001238 start + 52
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff9ab4cefa kevent_qos + 10
1 libdispatch.dylib 0x00007fff97b8a165 _dispatch_mgr_invoke + 216
2 libdispatch.dylib 0x00007fff97b89dcd _dispatch_mgr_thread + 52
Thread 2:
0 libsystem_kernel.dylib 0x00007fff9ab4bdb6 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8afaa728 _pthread_cond_wait + 767
2 libjvm.dylib 0x0000000104d2f85f os::PlatformEvent::park() + 173
3 libjvm.dylib 0x0000000104d0f97a ParkCommon(ParkEvent*, long long) + 42
4 libjvm.dylib 0x0000000104d1016c Monitor::IWait(Thread*, long long) + 160
5 libjvm.dylib 0x0000000104d10348 Monitor::wait(bool, long, bool) + 246
6 libjvm.dylib 0x0000000104e0943c Threads::destroy_vm() + 80
7 libjvm.dylib 0x0000000104c20cdd jni_DestroyJavaVM + 223
8 com.jetbrains.intellij 0x0000000100003837 -[Launcher launch] + 851
9 com.apple.Foundation 0x00007fff9ced4e64 __NSThread__start__ + 1351
10 libsystem_pthread.dylib 0x00007fff8afa999d _pthread_body + 131
11 libsystem_pthread.dylib 0x00007fff8afa991a _pthread_start + 168
12 libsystem_pthread.dylib 0x00007fff8afa7351 thread_start + 13
I don't know why is this, who can explain it for me?
Looks like a bug in IDEA, see the issue IDEA-146955.

Interpret Mac OS X crash report

I just really need some help deciphering this crash report:
Process: Farm Hand [616]
Path: /Applications/Farm Hand.app/Contents/MacOS/Farm Hand
Identifier: Farm Hand
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: Instruments [386]
Responsible: Instruments [386]
User ID: 501
Date/Time: 2014-10-12 00:13:17.116 +0100
OS Version: Mac OS X 10.10 (14A388a)
Report Version: 11
Anonymous UUID: 9C6E9671-468C-DBE5-F856-4D6923A3F425
Time Awake Since Boot: 1400 seconds
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fd37a589ae0
VM Regions Near 0x7fd37a589ae0:
MALLOC_TINY 00007fd37a400000-00007fd37a500000 [ 1024K] rw-/rwx SM=PRV
--> MALLOC_TINY 00007fd37a500000-00007fd37a800000 [ 3072K] rw-/rwx SM=COW
MALLOC_SMALL 00007fd37a800000-00007fd37a83c000 [ 240K] rw-/rwx SM=ZER
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x00007fd37a589ae0 0 + 140546267454176
1 com.apple.AppKit 0x00007fff9230b67a -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1875
2 com.apple.AppKit 0x00007fff92309516 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 913
3 com.apple.AppKit 0x00007fff92308c73 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 333
4 com.apple.AppKit 0x00007fff923057cb -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2761
5 com.apple.AppKit 0x00007fff922e41ca -[NSView displayIfNeeded] + 1876
6 com.apple.AppKit 0x00007fff923016c5 -[NSWindow displayIfNeeded] + 232
7 com.apple.AppKit 0x00007fff9233e8c2 _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 936
8 com.apple.AppKit 0x00007fff92903d91 __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke1523 + 46
9 com.apple.CoreFoundation 0x00007fff8c8f9d87 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
10 com.apple.CoreFoundation 0x00007fff8c8f9ce0 __CFRunLoopDoObservers + 368
11 com.apple.CoreFoundation 0x00007fff8c8ebde8 __CFRunLoopRun + 872
12 com.apple.CoreFoundation 0x00007fff8c8eb838 CFRunLoopRunSpecific + 296
13 com.apple.HIToolbox 0x00007fff990a043f RunCurrentEventLoopInMode + 235
14 com.apple.HIToolbox 0x00007fff990a00be ReceiveNextEventCommon + 179
15 com.apple.HIToolbox 0x00007fff9909fffb _BlockUntilNextEventMatchingListInModeWithFilter + 71
16 com.apple.AppKit 0x00007fff921df821 _DPSNextEvent + 964
17 com.apple.AppKit 0x00007fff921defd0 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
18 com.apple.AppKit 0x00007fff921d2f73 -[NSApplication run] + 594
19 com.apple.AppKit 0x00007fff921be424 NSApplicationMain + 1832
20 libdyld.dylib 0x00007fff919c15c9 start + 1
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff8e8dc22e kevent64 + 10
1 libdispatch.dylib 0x00007fff9a706a6a _dispatch_mgr_thread + 52
Thread 2:
0 libsystem_kernel.dylib 0x00007fff8e8db946 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff9aac04a1 start_wqthread + 13
Thread 3:
0 libsystem_kernel.dylib 0x00007fff8e8db946 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff9aac04a1 start_wqthread + 13
Thread 4:: Dispatch queue: com.apple.root.default-qos
0 libsqlite3.dylib 0x00007fff97cdf4b4 sqlite3HashInsert + 100
1 libsqlite3.dylib 0x00007fff97d7ef9e sqlite3CreateForeignKey + 1358
2 libsqlite3.dylib 0x00007fff97cea93e yy_reduce + 4622
3 libsqlite3.dylib 0x00007fff97ce95ea sqlite3Parser + 122
4 libsqlite3.dylib 0x00007fff97ce8544 sqlite3RunParser + 324
5 libsqlite3.dylib 0x00007fff97ce7cfa sqlite3Prepare + 794
6 libsqlite3.dylib 0x00007fff97ce78e7 sqlite3LockAndPrepare + 231
7 libsqlite3.dylib 0x00007fff97d0d3c3 sqlite3InitCallback + 771
8 libsqlite3.dylib 0x00007fff97ce74a4 sqlite3_exec + 964
9 libsqlite3.dylib 0x00007fff97d0ce21 sqlite3InitOne + 1457
10 libsqlite3.dylib 0x00007fff97d0c7de sqlite3Init + 94
11 libsqlite3.dylib 0x00007fff97d27f75 selectExpander + 1941
12 libsqlite3.dylib 0x00007fff97d27671 sqlite3WalkSelect + 81
13 libsqlite3.dylib 0x00007fff97def1ba sqlite3SelectPrep + 154
14 libsqlite3.dylib 0x00007fff97d1bde0 sqlite3Select + 464
15 libsqlite3.dylib 0x00007fff97ceaaae yy_reduce + 4990
16 libsqlite3.dylib 0x00007fff97ce95ea sqlite3Parser + 122
17 libsqlite3.dylib 0x00007fff97ce85f6 sqlite3RunParser + 502
18 libsqlite3.dylib 0x00007fff97ce7cfa sqlite3Prepare + 794
19 libsqlite3.dylib 0x00007fff97ce78e7 sqlite3LockAndPrepare + 231
20 libsqlite3.dylib 0x00007fff97d7de33 sqlite3_prepare_v2 + 195
21 rh.CoreFarmHand 0x0000000109eeb500 -[RHFileController loadSheepMovementsOff:fromDatabaseAtPath:] + 624 (RHFileController.m:3330)
22 rh.CoreFarmHand 0x0000000109ebd442 __73-[RHFarmDataController loadResourcesFromDatabaseForYear:animation:error:]_block_invoke + 4690 (RHFarmDataController.m:218)
23 libdispatch.dylib 0x00007fff9a708323 _dispatch_call_block_and_release + 12
24 libdispatch.dylib 0x00007fff9a703c13 _dispatch_client_callout + 8
25 libdispatch.dylib 0x00007fff9a70688f _dispatch_root_queue_drain + 935
26 libdispatch.dylib 0x00007fff9a714fe4 _dispatch_worker_thread3 + 91
27 libsystem_pthread.dylib 0x00007fff9aac26cb _pthread_wqthread + 729
28 libsystem_pthread.dylib 0x00007fff9aac04a1 start_wqthread + 13
Thread 5:: Dispatch queue: com.apple.root.default-qos
0 libobjc.A.dylib 0x00007fff97aefb89 getMethodNoSuper_nolock(objc_class*, objc_selector*) + 71
1 libobjc.A.dylib 0x00007fff97ae3a09 class_getInstanceMethod + 75
2 com.apple.Foundation 0x00007fff8e4d5218 -[NSKeyValueUndefinedSetter initWithContainerClassID:key:containerIsa:] + 76
3 com.apple.Foundation 0x00007fff8e4d515b +[NSObject(NSKeyValueCodingPrivate) _createValuePrimitiveSetterWithContainerClassID:key:] + 504
4 com.apple.Foundation 0x00007fff8e4b89db +[NSObject(NSKeyValueCodingPrivate) _createValueSetterWithContainerClassID:key:] + 540
5 com.apple.Foundation 0x00007fff8e4b8748 _NSKeyValueSetterForClassAndKey + 268
6 com.apple.Foundation 0x00007fff8e4b7e36 _NSKVONotifyingEnableForInfoAndKey + 222
7 com.apple.Foundation 0x00007fff8e491c7e -[NSKeyValueUnnestedProperty _isaForAutonotifying] + 101
8 com.apple.Foundation 0x00007fff8e491ada -[NSKeyValueUnnestedProperty isaForAutonotifying] + 74
9 com.apple.Foundation 0x00007fff8e4b737d -[NSObject(NSKeyValueObserverRegistration) _addObserver:forProperty:options:context:] + 602
10 com.apple.Foundation 0x00007fff8e4b6f7a -[NSObject(NSKeyValueObserverRegistration) addObserver:forKeyPath:options:context:] + 107
11 rh.CoreFarmHand 0x0000000109e965f9 __38-[RHPersistentManager addSheepDeaths:]_block_invoke259 + 681 (RHPersistentManager.m:1074)
12 libdispatch.dylib 0x00007fff9a708323 _dispatch_call_block_and_release + 12
13 libdispatch.dylib 0x00007fff9a703c13 _dispatch_client_callout + 8
14 libdispatch.dylib 0x00007fff9a70688f _dispatch_root_queue_drain + 935
15 libdispatch.dylib 0x00007fff9a714fe4 _dispatch_worker_thread3 + 91
16 libsystem_pthread.dylib 0x00007fff9aac26cb _pthread_wqthread + 729
17 libsystem_pthread.dylib 0x00007fff9aac04a1 start_wqthread + 13
Thread 6:
0 libsystem_kernel.dylib 0x00007fff8e8db946 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff9aac04a1 start_wqthread + 13
Thread 7:
0 libsystem_kernel.dylib 0x00007fff8e8d652e mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8e8d569f mach_msg + 55
2 com.apple.CoreFoundation 0x00007fff8c8ecb14 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fff8c8ebfdb __CFRunLoopRun + 1371
4 com.apple.CoreFoundation 0x00007fff8c8eb838 CFRunLoopRunSpecific + 296
5 com.apple.AppKit 0x00007fff923428f7 _NSEventThread + 137
6 libsystem_pthread.dylib 0x00007fff9aac22fc _pthread_body + 131
7 libsystem_pthread.dylib 0x00007fff9aac2279 _pthread_start + 176
8 libsystem_pthread.dylib 0x00007fff9aac04b1 thread_start + 13
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x00007fd37a7e96b0 rcx: 0x00000000000fc080 rdx: 0x000000000002fb10
rdi: 0x00007fd37a4a5700 rsi: 0x00007fff92b52ae3 rbp: 0x00007fff55df9420 rsp: 0x00007fff55df91d0
r8: 0x0000000000000006 r9: 0x00007fd37a400000 r10: 0x00007fd37b087e30 r11: 0x00007fff7c561ec8
r12: 0x00007fd37a4a5700 r13: 0x0000000000000000 r14: 0x0000014a164eaad8 r15: 0x0000000000000088
rip: 0x00007fd37a589ae0 rfl: 0x0000000000010202 cr2: 0x00007fd37a589ae0
Logical CPU: 1
Error Code: 0x00000015
Trap Number: 14
I'm fairly sure this is a stack overflow. Am I correct and is it a recursive loop that is doing it? If not what is happening!
No, it is not a stack overflow. The illegal access is at 0x00007fd37a589ae0. [NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:], 1875 bytes within its code, tried to jump there, and this memory area is reserved for data, not code. The particular piece of code [NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] does not have to be at fault, or indeed any piece of code that appears in the call stack. The crash may be the consequence of a bug in any function that has been called (directly or indirectly) by a function that appears in the call stack, and this function may no longer be featured in the call stack because it has finished executing and left a time bomb in memory.
The stack pointer register contains the value 0x00007fff55df91d0, confirming that an illegal access at 0x00007fd37a589ae0 is not likely to be the stack overflowing.
Also, if you are not the author of Farm Hand, there is nothing useful you can do with this report except send it to the author of Farm Hand (and hope this person is the kind of programmer that can make sense of it) or launch a debugger for a long and tedious session. All the interpretations you suggest in your question (recursion, stack overflow) appear to be wrong.

Cocoa App crash calling a 3rd party API

My Cocoa Objective-C app (in XCode) occasionally crashes in the part where it calls a 3rd party API. I believe that it's a memory leak or something. I attach the part where my program will, the 3rd party API and the crash log.
Please help to give me pointers on how I can solve this. Thanks a lot!
My code:
.
.
.
uint8_t InfoProg[4];//10
uint8_t nInfoProg = 4;//10
uint8_t ret;
NSString *result;
NSLog(#"***Calling GetConnectedProgramers***");
ret = GetConnectedProgrammers(InfoProg, nInfoProg); // The part where it crashes sometimes
.
.
.
3rd party API function:
/**
GET INFO ON CONNECTED USB PROGRAMMERS
reports back the number of connected USB programmer devices on the host
#param InfoProg
points to the memory that will be filled with the info on the connected
USB programmers;
it is the responsibility of the application to allocate this memory
and to size it sufficiently. This should be an buffer with at least 8 bytes.
InfoProg[x] = 0; no USB programmer allocated to that number
InfoProg[x] = 1; USB programmer allocated to that number = USB programmer available
#param nInfoProg
is the number of requested data structures
#return
is the number of programmers connected
*/
uint8_t GetConnectedProgrammers (uint8_t *InfoProg, uint8_t nInfoProg);
Crash Report:
Process: FCT_MACOS [575]
Path: /Virgo_FG2_EVT/FCT_MACOS3p55c.app/Contents/MacOS/FCT_MACOS
Identifier: com.TopTest.FCTMACOS
Version: 3.55c (3.55c)
Code Type: X86 (Native)
Parent Process: launchd [132]
Date/Time: 2012-08-03 10:34:35.151 +0800
OS Version: Mac OS X 10.7.3 (11D2001)
Report Version: 9
Interval Since Last Report: 16921 sec
Crashes Since Last Report: 3
Per-App Interval Since Last Report: 5164 sec
Per-App Crashes Since Last Report: 3
Anonymous UUID: 22314E10-99B9-4989-A2E8-53631295027B
Crashed Thread: 4
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000000005a5
VM Regions Near 0x5a5:
--> __PAGEZERO 0000000000000000-0000000000001000 [ 4K] ---/--- SM=NUL /Virgo_FG2_EVT/FCT_MACOS3p55c.app/Contents/MacOS/FCT_MACOS
VM_ALLOCATE 0000000000001000-0000000000013000 [ 72K] ---/--- SM=NUL
Application Specific Information:
objc_msgSend() selector name: isEqual:
objc[575]: garbage collection is OFF
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x964edc22 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x964ed1f6 mach_msg + 70
2 com.apple.CoreFoundation 0x9677ec7a __CFRunLoopServiceMachPort + 170
3 com.apple.CoreFoundation 0x96787da4 __CFRunLoopRun + 1428
4 com.apple.CoreFoundation 0x9678747c CFRunLoopRunSpecific + 332
5 com.apple.CoreFoundation 0x96787328 CFRunLoopRunInMode + 120
6 com.apple.HIToolbox 0x9973417f RunCurrentEventLoopInMode + 318
7 com.apple.HIToolbox 0x9973b4e7 ReceiveNextEventCommon + 381
8 com.apple.HIToolbox 0x9973b356 BlockUntilNextEventMatchingListInMode + 88
9 com.apple.AppKit 0x957dfa9c _DPSNextEvent + 678
10 com.apple.AppKit 0x957df306 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 113
11 com.apple.AppKit 0x957db675 -[NSApplication run] + 911
12 com.apple.AppKit 0x95a6f261 NSApplicationMain + 1054
13 com.TopTest.FCTMACOS 0x00014055 start + 53
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x964f090a kevent + 10
1 libdispatch.dylib 0x97c1dc58 _dispatch_mgr_invoke + 969
2 libdispatch.dylib 0x97c1c6a7 _dispatch_mgr_thread + 53
Thread 2:
0 libsystem_kernel.dylib 0x964f0ef2 __sem_wait + 10
1 com.ni.framework.nipalu 0x001ebd0b tTimerTimeWasterSleep::sleep(u64, tTimerTimeUnit, long*) const + 3019
2 com.ni.framework.NI4882 0x06cad33c WaitSRQ + 99996
3 com.ni.framework.nipalu 0x001edc78 tThreadUtility::getCurrentThreadId() + 104
4 libsystem_c.dylib 0x918aeed9 _pthread_start + 335
5 libsystem_c.dylib 0x918b26de thread_start + 34
Thread 3:
0 libsystem_kernel.dylib 0x964edc22 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x964ed1f6 mach_msg + 70
2 com.apple.framework.IOKit 0x982f92df io_connect_method + 465
3 com.apple.framework.IOKit 0x982a9f21 IOConnectCallMethod + 559
4 com.apple.framework.IOKit 0x982aa21b IOConnectCallStructMethod + 84
5 com.ni.framework.nipalu 0x001f11f1 tThreadUtility::yield(iThreadController*, long*) + 12993
6 com.ni.framework.nipalu 0x001ec4b3 tTimerTimeWasterSleep::sleep(u64, tTimerTimeUnit, long*) const + 4979
7 com.ni.framework.NI4882 0x06c9940a WaitSRQ + 18282
8 com.ni.framework.nipalu 0x001edc78 tThreadUtility::getCurrentThreadId() + 104
9 libsystem_c.dylib 0x918aeed9 _pthread_start + 335
10 libsystem_c.dylib 0x918b26de thread_start + 34
Thread 4 Crashed:
0 libobjc.A.dylib 0x915bcd47 objc_msgSend + 23
1 com.apple.CoreFoundation 0x9675b57a CFEqual + 154
2 com.apple.framework.IOKit 0x982cbc80 IOHIDDeviceUnscheduleFromRunLoop + 29
3 com.TopTest.FCTMACOS 0x0008dee2 closeAll + 66
4 com.apple.CoreFoundation 0x967ea298 -[NSObject performSelector:withObject:withObject:] + 72
5 com.TopTest.FCTMACOS 0x000213ff -[TestViewController threadRunTest:] + 2593
6 com.apple.Foundation 0x97ddbe59 -[NSThread main] + 45
7 com.apple.Foundation 0x97ddbe09 __NSThread__main__ + 1582
8 libsystem_c.dylib 0x918aeed9 _pthread_start + 335
9 libsystem_c.dylib 0x918b26de thread_start + 34
Thread 5:
0 libsystem_kernel.dylib 0x964f002e __workq_kernreturn + 10
1 libsystem_c.dylib 0x918b0ccf _pthread_wqthread + 773
2 libsystem_c.dylib 0x918b26fe start_wqthread + 30
Thread 6:
0 libsystem_kernel.dylib 0x964f002e __workq_kernreturn + 10
1 libsystem_c.dylib 0x918b0ccf _pthread_wqthread + 773
2 libsystem_c.dylib 0x918b26fe start_wqthread + 30
Thread 7:
0 libsystem_kernel.dylib 0x964f002e __workq_kernreturn + 10
1 libsystem_c.dylib 0x918b0ccf _pthread_wqthread + 773
2 libsystem_c.dylib 0x918b26fe start_wqthread + 30
Thread 8:
0 libsystem_kernel.dylib 0x964f002e __workq_kernreturn + 10
1 libsystem_c.dylib 0x918b0ccf _pthread_wqthread + 773
2 libsystem_c.dylib 0x918b26fe start_wqthread + 30
Thread 9:
0 libsystem_kernel.dylib 0x964f002e __workq_kernreturn + 10
1 libsystem_c.dylib 0x918b0ccf _pthread_wqthread + 773
2 libsystem_c.dylib 0x918b26fe start_wqthread + 30
Thread 10:
0 libsystem_kernel.dylib 0x964efbb2 __semwait_signal + 10
1 libsystem_c.dylib 0x918637b9 nanosleep$UNIX2003 + 187
2 com.apple.Foundation 0x97e1c05f +[NSThread sleepForTimeInterval:] + 170
3 com.TopTest.FCTMACOS 0x0006cbd7 -[RS232 threadB139RS232Read:] + 223
4 com.apple.Foundation 0x97ddbe59 -[NSThread main] + 45
5 com.apple.Foundation 0x97ddbe09 __NSThread__main__ + 1582
6 libsystem_c.dylib 0x918aeed9 _pthread_start + 335
7 libsystem_c.dylib 0x918b26de thread_start + 34
Thread 4 crashed with X86 Thread State (32-bit):
eax: 0x78690d00 ebx: 0xac7d8724 ecx: 0x96128a48 edx: 0x00000585
edi: 0x7868cc80 esi: 0x78615800 ebp: 0xb0102c18 esp: 0xb0102bf8
ss: 0x00000023 efl: 0x00010206 eip: 0x915bcd47 cs: 0x0000001b
ds: 0x00000023 es: 0x00000023 fs: 0x00000023 gs: 0x0000000f
cr2: 0x000005a5
Logical CPU: 2
...
From the docs;
#param InfoProg
This should be an buffer with at least 8 bytes.
but
uint8_t InfoProg[4];
only consists of 4 uint8_t (bytes). Try increasing your buffer.

What's going wrong in this crash log

So i have this crash log from my application. I don't have much experience in reading such logs :( Could someone please help me?
Thanks
CrashLog:
Process: SoundCloud Downloader [15495]
Path: /Applications/SoundCloud Downloader.app/Contents/MacOS/SoundCloud Downloader
Identifier: com.BirdiCode.SoundCloud_Downloader
Version: 2.1.1 (b7)
Code Type: X86-64 (Native)
Parent Process: launchd [227]
Date/Time: 2012-01-08 15:16:21.614 +0100
OS Version: Mac OS X 10.7.2 (11C74)
Report Version: 9
Crashed Thread: 7
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000
VM Regions Near 0:
-->
__TEXT 0000000100000000-0000000100053000 [ 332K] r-x/rwx SM=COW /Applications/SoundCloud Downloader.app/Contents/MacOS/SoundCloud Downloader
Application Specific Information:
objc_msgSend() selector name: _cfTypeID
objc[15495]: garbage collection is OFF
Thread 0:: Dispatch queue: com.apple.main-thread
0 libunwind.dylib 0x00007fff8bf97239 libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncodingRBPFrame(unsigned int, unsigned long long, libunwind::LocalAddressSpace&, libunwind::Registers_x86_64&) + 1
1 libunwind.dylib 0x00007fff8bf971fd libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncoding(unsigned int, unsigned long long, libunwind::LocalAddressSpace&, libunwind::Registers_x86_64&) + 37
2 libunwind.dylib 0x00007fff8bf97171 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step() + 69
3 libobjc.A.dylib 0x00007fff91442294 objc_addExceptionHandler + 82
4 com.apple.CoreFoundation 0x00007fff94d27d44 _CFDoExceptionOperation + 308
5 com.apple.AppKit 0x00007fff8ffd3309 _NSAppKitLock + 73
6 com.apple.AppKit 0x00007fff9009acb2 -[NSCGSContext _invalidate] + 57
7 com.apple.AppKit 0x00007fff9009ac53 -[NSCGSContext dealloc] + 27
8 com.apple.AppKit 0x00007fff9009ac31 -[NSWindowGraphicsContext dealloc] + 67
9 com.apple.AppKit 0x00007fff9009abe5 -[NSBitmapGraphicsContext dealloc] + 92
10 libobjc.A.dylib 0x00007fff9144003c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 434
11 com.apple.CoreFoundation 0x00007fff94cc5f75 _CFAutoreleasePoolPop + 37
12 com.apple.Foundation 0x00007fff8a83c2a6 __NSFireDelayedPerform + 468
13 com.apple.CoreFoundation 0x00007fff94cecf84 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
14 com.apple.CoreFoundation 0x00007fff94cecad6 __CFRunLoopDoTimer + 534
15 com.apple.CoreFoundation 0x00007fff94ccd471 __CFRunLoopRun + 1617
16 com.apple.CoreFoundation 0x00007fff94cccae6 CFRunLoopRunSpecific + 230
17 com.apple.HIToolbox 0x00007fff8c02a3d3 RunCurrentEventLoopInMode + 277
18 com.apple.HIToolbox 0x00007fff8c03163d ReceiveNextEventCommon + 355
19 com.apple.HIToolbox 0x00007fff8c0314ca BlockUntilNextEventMatchingListInMode + 62
20 com.apple.AppKit 0x00007fff8ffd83f1 _DPSNextEvent + 659
21 com.apple.AppKit 0x00007fff8ffd7cf5 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135
22 com.apple.AppKit 0x00007fff8ffd462d -[NSApplication run] + 470
23 com.apple.AppKit 0x00007fff9025380c NSApplicationMain + 867
24 com.BirdiCode.SoundCloud_Downloader 0x0000000100001e50 start + 52
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff8c7c97e6 kevent + 10
1 libdispatch.dylib 0x00007fff8f5cb5be _dispatch_mgr_invoke + 923
2 libdispatch.dylib 0x00007fff8f5ca14e _dispatch_mgr_thread + 54
Thread 2:: com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x00007fff8c7c767a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8c7c6d71 mach_msg + 73
2 com.apple.CoreFoundation 0x00007fff94cc4b6c __CFRunLoopServiceMachPort + 188
3 com.apple.CoreFoundation 0x00007fff94ccd2d4 __CFRunLoopRun + 1204
4 com.apple.CoreFoundation 0x00007fff94cccae6 CFRunLoopRunSpecific + 230
5 com.apple.Foundation 0x00007fff8a8960ab +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 335
6 com.apple.Foundation 0x00007fff8a88a7fe -[NSThread main] + 68
7 com.apple.Foundation 0x00007fff8a88a776 __NSThread__main__ + 1575
8 libsystem_c.dylib 0x00007fff8a60e8bf _pthread_start + 335
9 libsystem_c.dylib 0x00007fff8a611b75 thread_start + 13
Thread 3:: com.apple.CFSocket.private
0 libsystem_kernel.dylib 0x00007fff8c7c8df2 __select + 10
1 com.apple.CoreFoundation 0x00007fff94d15f9b __CFSocketManager + 1355
2 libsystem_c.dylib 0x00007fff8a60e8bf _pthread_start + 335
3 libsystem_c.dylib 0x00007fff8a611b75 thread_start + 13
Thread 4:
0 libsystem_kernel.dylib 0x00007fff8c7c9192 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8a610594 _pthread_wqthread + 758
2 libsystem_c.dylib 0x00007fff8a611b85 start_wqthread + 13
Thread 5:
0 libsystem_kernel.dylib 0x00007fff8c7c9192 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8a610594 _pthread_wqthread + 758
2 libsystem_c.dylib 0x00007fff8a611b85 start_wqthread + 13
Thread 6:
0 libsystem_kernel.dylib 0x00007fff8c7c9192 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8a610594 _pthread_wqthread + 758
2 libsystem_c.dylib 0x00007fff8a611b85 start_wqthread + 13
Thread 7 Crashed:
0 libobjc.A.dylib 0x00007fff9143ae90 objc_msgSend + 16
1 com.apple.CoreFoundation 0x00007fff94ca6ae0 CFGetTypeID + 240
2 com.apple.CoreGraphics 0x00007fff8b1a31f0 CGSReleaseRegion + 23
3 com.apple.AppKit 0x00007fff9001ac0d -[NSRegion dealloc] + 33
4 com.apple.AppKit 0x00007fff900a23fc +[_NSAutomaticFocusRing showForView:] + 2655
5 com.apple.AppKit 0x00007fff9001acbe -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 136
6 com.apple.AppKit 0x00007fff9001493e -[NSView displayIfNeeded] + 1676
7 com.apple.AppKit 0x00007fff9016ca18 -[NSWindow setFrame:display:animate:] + 1320
8 com.BirdiCode.SoundCloud_Downloader 0x0000000100015682 -[SoundCloud_DownloaderAppDelegate expandTheWindowForDownload] + 654
9 com.BirdiCode.SoundCloud_Downloader 0x0000000100016374 -[SoundCloud_DownloaderAppDelegate addToDownloadsQue:title:artist:buy:] + 2900
10 com.BirdiCode.SoundCloud_Downloader 0x00000001000126f9 -[SoundCloud_DownloaderAppDelegate prepareForDownloadThread:] + 727
11 com.BirdiCode.SoundCloud_Downloader 0x00000001000129c6 -[SoundCloud_DownloaderAppDelegate prepareThread1] + 70
12 com.apple.Foundation 0x00007fff8a88a7fe -[NSThread main] + 68
13 com.apple.Foundation 0x00007fff8a88a776 __NSThread__main__ + 1575
14 libsystem_c.dylib 0x00007fff8a60e8bf _pthread_start + 335
15 libsystem_c.dylib 0x00007fff8a611b75 thread_start + 13
Thread 8:
0 libsystem_kernel.dylib 0x00007fff8c7c9192 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8a610594 _pthread_wqthread + 758
2 libsystem_c.dylib 0x00007fff8a611b85 start_wqthread + 13
Thread 9:
0 libsystem_kernel.dylib 0x00007fff8c7c767a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8c7c6d71 mach_msg + 73
2 com.apple.CoreFoundation 0x00007fff94cc4b6c __CFRunLoopServiceMachPort + 188
3 com.apple.CoreFoundation 0x00007fff94ccd2d4 __CFRunLoopRun + 1204
4 com.apple.CoreFoundation 0x00007fff94cccae6 CFRunLoopRunSpecific + 230
5 com.apple.Foundation 0x00007fff8a83c04f -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 267
6 com.BirdiCode.SoundCloud_Downloader 0x0000000100029601 -[ASIHTTPRequest startSynchronous] + 229
7 com.BirdiCode.SoundCloud_Downloader 0x0000000100013849 -[SoundCloud_DownloaderAppDelegate downloadThisFromThread:] + 952
8 com.BirdiCode.SoundCloud_Downloader 0x0000000100014db2 -[SoundCloud_DownloaderAppDelegate downloadT1] + 70
9 com.apple.Foundation 0x00007fff8a88a7fe -[NSThread main] + 68
10 com.apple.Foundation 0x00007fff8a88a776 __NSThread__main__ + 1575
11 libsystem_c.dylib 0x00007fff8a60e8bf _pthread_start + 335
12 libsystem_c.dylib 0x00007fff8a611b75 thread_start + 13
Thread 10:
0 libsystem_kernel.dylib 0x00007fff8c7c767a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8c7c6d71 mach_msg + 73
2 com.apple.CoreFoundation 0x00007fff94cc4b6c __CFRunLoopServiceMachPort + 188
3 com.apple.CoreFoundation 0x00007fff94ccd2d4 __CFRunLoopRun + 1204
4 com.apple.CoreFoundation 0x00007fff94cccae6 CFRunLoopRunSpecific + 230
5 com.apple.Foundation 0x00007fff8a83c04f -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 267
6 com.BirdiCode.SoundCloud_Downloader 0x0000000100029601 -[ASIHTTPRequest startSynchronous] + 229
7 com.BirdiCode.SoundCloud_Downloader 0x00000001000139c3 -[SoundCloud_DownloaderAppDelegate downloadThisFromThread:] + 1330
8 com.BirdiCode.SoundCloud_Downloader 0x0000000100014ccb -[SoundCloud_DownloaderAppDelegate downloadT2] + 70
9 com.apple.Foundation 0x00007fff8a88a7fe -[NSThread main] + 68
10 com.apple.Foundation 0x00007fff8a88a776 __NSThread__main__ + 1575
11 libsystem_c.dylib 0x00007fff8a60e8bf _pthread_start + 335
12 libsystem_c.dylib 0x00007fff8a611b75 thread_start + 13
Thread 11:
0 libsystem_kernel.dylib 0x00007fff8c7c767a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8c7c6d71 mach_msg + 73
2 com.apple.CoreFoundation 0x00007fff94cc4b6c __CFRunLoopServiceMachPort + 188
3 com.apple.CoreFoundation 0x00007fff94ccd2d4 __CFRunLoopRun + 1204
4 com.apple.CoreFoundation 0x00007fff94cccae6 CFRunLoopRunSpecific + 230
5 com.apple.Foundation 0x00007fff8a83c04f -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 267
6 com.BirdiCode.SoundCloud_Downloader 0x0000000100029601 -[ASIHTTPRequest startSynchronous] + 229
7 com.BirdiCode.SoundCloud_Downloader 0x0000000100013b3d -[SoundCloud_DownloaderAppDelegate downloadThisFromThread:] + 1708
8 com.BirdiCode.SoundCloud_Downloader 0x0000000100014be4 -[SoundCloud_DownloaderAppDelegate downloadT3] + 70
9 com.apple.Foundation 0x00007fff8a88a7fe -[NSThread main] + 68
10 com.apple.Foundation 0x00007fff8a88a776 __NSThread__main__ + 1575
11 libsystem_c.dylib 0x00007fff8a60e8bf _pthread_start + 335
12 libsystem_c.dylib 0x00007fff8a611b75 thread_start + 13
Thread 7 crashed with X86 Thread State (64-bit):
rax: 0x00007fff7a7a5b00 rbx: 0x0000000101aad400 rcx: 0xf000000000000000 rdx: 0x00007fff7a7d56c0
rdi: 0x0000000101aad400 rsi: 0x00007fff9089fb17 rbp: 0x000000010a1da1d0 rsp: 0x000000010a1da1b0
r8: 0x0000000000000080 r9: 0x0000000000000180 r10: 0x000000010035ec80 r11: 0xf000000000000000
r12: 0x000000010a5263b0 r13: 0x00000000000000e0 r14: 0x000000010a527250 r15: 0x000000010a526500
rip: 0x00007fff9143ae90 rfl: 0x0000000000010246 cr2: 0x000000010a527000
Logical CPU: 0
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 7
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 167922
thread_create: 2
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=162.9M resident=115.1M(71%) swapped_out_or_unallocated=47.8M(29%)
Writable regions: Total=122.9M written=12.7M(10%) resident=21.4M(17%) swapped_out=860K(1%) unallocated=101.4M(83%)
REGION TYPE VIRTUAL
=========== =======
CG backing stores 1496K
CG image 1872K
CG raster data 1988K
CG shared images 3512K
CoreGraphics 16K
CoreImage 4K
CoreServices 2888K
MALLOC 86.6M
MALLOC guard page 32K
Memory tag=240 4K
Memory tag=242 12K
Memory tag=243 12K
Memory tag=251 8K
OpenCL 8K
STACK GUARD 56.0M
Stack 13.1M
VM_ALLOCATE 16.2M
__CI_BITMAP 80K
__DATA 15.3M
__IMAGE 1256K
__LINKEDIT 48.2M
__RC_CAMERAS 236K
__TEXT 114.7M
__UNICODE 544K
mapped file 45.3M
shared memory 17.7M
=========== =======
TOTAL 426.9M
Also, ist there a book or some website where i could learn how to read crash logs?
Update:
Here is the code for expandWindowForDownload
- (void)expandTheWindowForDownload
{
// Get the window size
NSRect frame = [window frame];
frame.origin.y += frame.size.height - 201;
frame.size.height = 201;
// Apply it
[window setFrame:frame display:YES animate:YES];
}
Here are the things I normally look for:
Exception type
This normally helps you to understand what the basic problem is. In your case, the exception type is EXC_BAD_ACCESS:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
As Google, Stack Overflow or Apple will tell you, these kind of errors occur when you try to access an object after you've released it. (One common root cause of this is if you "over-release" an object - i.e. you call the release method on an object more often than it had been retained.)
Xcode can often find the source of these kind of errors when you run "Analyze" from the Product menu. (In Xcode 3 it's "Build and Analyze" from the Build menu if I recall correctly.) So give that a try, it might save you some time. Otherwise...
Crashed Thread
You'll find this at the top of the crash log, right above the exception type. In your case you've got:
Crashed Thread: 7
This allows you to discard most of the content of the crash log and concentrate on just the thread that caused the crash. So the bit you're interested in is this:
Thread 7 Crashed:
0 libobjc.A.dylib 0x00007fff9143ae90 objc_msgSend + 16
1 com.apple.CoreFoundation 0x00007fff94ca6ae0 CFGetTypeID + 240
2 com.apple.CoreGraphics 0x00007fff8b1a31f0 CGSReleaseRegion + 23
3 com.apple.AppKit 0x00007fff9001ac0d -[NSRegion dealloc] + 33
4 com.apple.AppKit 0x00007fff900a23fc +[_NSAutomaticFocusRing showForView:] + 2655
5 com.apple.AppKit 0x00007fff9001acbe -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 136
6 com.apple.AppKit 0x00007fff9001493e -[NSView displayIfNeeded] + 1676
7 com.apple.AppKit 0x00007fff9016ca18 -[NSWindow setFrame:display:animate:] + 1320
8 com.BirdiCode.SoundCloud_Downloader 0x0000000100015682 -[SoundCloud_DownloaderAppDelegate expandTheWindowForDownload] + 654
9 com.BirdiCode.SoundCloud_Downloader 0x0000000100016374 -[SoundCloud_DownloaderAppDelegate addToDownloadsQue:title:artist:buy:] + 2900
10 com.BirdiCode.SoundCloud_Downloader 0x00000001000126f9 -[SoundCloud_DownloaderAppDelegate prepareForDownloadThread:] + 727
11 com.BirdiCode.SoundCloud_Downloader 0x00000001000129c6 -[SoundCloud_DownloaderAppDelegate prepareThread1] + 70
12 com.apple.Foundation 0x00007fff8a88a7fe -[NSThread main] + 68
13 com.apple.Foundation 0x00007fff8a88a776 __NSThread__main__ + 1575
14 libsystem_c.dylib 0x00007fff8a60e8bf _pthread_start + 335
15 libsystem_c.dylib 0x00007fff8a611b75 thread_start + 13
Now you can work down this stack trace from top to bottom until you reach the first call from your own code. (In theory it's possible that the crash is being caused by an error in Apple's code, but in practice it's almost always our code, not theirs.)
So for you the line of code where things have started to go wrong is:
8 com.BirdiCode.SoundCloud_Downloader 0x0000000100015682 -[SoundCloud_DownloaderAppDelegate expandTheWindowForDownload] + 654
Have a look through the expandTheWindowForDownload method and see if you can spot where you're accessing a released object. If you can't spot it, post the code for that method here and we should be able to find the answer and help you understand what's gone wrong.
Ok, so for anyone viewing this I found the solution to the problem.
It seems to be if you resize the window and the user has "Focused" on a NSTextField while the window is resizing it may cause the crash. This happens on all text input except the NSForm.
This problem occurs on 10.7.2 & 10.7.3. I haven't tried it on any other versions of mac os x.
To solve this problem I just called [textField setEditable:NO]; before and [textField setEditable:YES]; after the window resizing call.
Anyway, thanks for helping!