What's going wrong in this crash log

Silicone picture Silicone · Jan 8, 2012 · Viewed 8.1k times · Source

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];
}

Answer

Simon Whitaker picture Simon Whitaker · Jan 8, 2012

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.