Skip to content

Instantly share code, notes, and snippets.

@bjhomer
Last active December 30, 2015 20:39
Show Gist options
  • Save bjhomer/7881841 to your computer and use it in GitHub Desktop.
Save bjhomer/7881841 to your computer and use it in GitHub Desktop.
Any idea what could cause this crash?

A user is reporting a crash, and I cannot see how it could possibly be happening.

The code in question (in frame #18 below) is this:

NSFont *font = [NSFont fontWithName:@"Helvetica Neue" size:13];
// some other code
NSGlyph typicalGlyph = [font glyphWithName:@"e"];

The font object is not nil. If it were, it would have crashed before this point.

Here's the relevant part of the crash log:

Code Type:       X86-64 (Native)
Parent Process:  launchd [193]
User ID:         502

Date/Time:       2013-12-04 20:17:29.086 +0100
OS Version:      Mac OS X 10.8.5 (12F45)
Report Version:  10

Interval Since Last Report:          326397 sec
Crashes Since Last Report:           236
Per-App Interval Since Last Report:  67 sec
Per-App Crashes Since Last Report:   10

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff897b8686 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff897b7c42 mach_msg + 70
2   com.apple.CoreGraphics          0x00007fff83516752 _CGSCacheGetUniqueID + 177
3   com.apple.CoreGraphics          0x00007fff83516647 CGSCacheGetUniqueID + 158
4   com.apple.CoreGraphics          0x00007fff83515d8a CGFontGetGFID + 328
5   com.apple.CoreGraphics          0x00007fff83515c1a CGFontGetIdentifier + 31
6   com.apple.CoreGraphics          0x00007fff835136a7 CGFontCacheRemoveFont + 114
7   com.apple.CoreGraphics          0x00007fff835134fc font_finalize + 32
8   com.apple.CoreFoundation        0x00007fff890573df CFRelease + 511
9   com.apple.CoreFoundation        0x00007fff8907e655 -[__NSArrayM dealloc] + 229
10  com.apple.CoreFoundation        0x00007fff8905728a CFRelease + 170
11  com.apple.CoreGraphics          0x00007fff835125ce CGFontCreateFontsWithURL + 615
12  com.apple.CoreText              0x00007fff8f3eed71 CreateFontWithFontURL(__CFURL const*) + 37
13  com.apple.CoreText              0x00007fff8f3eec1a TCGFontCache::CopyFont(__CFURL const*) const + 110
14  com.apple.CoreText              0x00007fff8f3eea92 TBaseFont::CopyNativeFont() const + 48
15  com.apple.CoreText              0x00007fff8f43a806 TFont::GetGlyphWithName(__CFString const*) const + 54
16  com.apple.CoreText              0x00007fff8f435351 CTFontGetGlyphWithName + 41
17  com.apple.AppKit                0x00007fff87d353bd -[NSFont glyphWithName:] + 63
18  com.dayoneapp.dayone            0x0000000104e7d865 0x104e4f000 + 190565
19  com.dayoneapp.dayone            0x0000000104e7dbcb 0x104e4f000 + 191435
20  com.dayoneapp.dayone            0x0000000104e7e212 0x104e4f000 + 193042
21  com.dayoneapp.dayone            0x0000000104e7e780 0x104e4f000 + 194432
22  com.dayoneapp.dayone            0x0000000104e6fbfa 0x104e4f000 + 134138
23  com.apple.AppKit                0x00007fff87b39ae2 -[NSTableView _sendDelegateHeightOfRow:] + 130
24  com.apple.AppKit                0x00007fff87b3989b -[NSTableView _uncachedRectHeightOfRow:] + 197
25  com.apple.AppKit                0x00007fff87b3973a -[_NSTableRowHeightStorage _cacheRowHeights] + 241
26  com.apple.AppKit                0x00007fff87af3e45 -[_NSTableRowHeightStorage _ensureRowHeights] + 80
27  com.apple.AppKit                0x00007fff87af3d1b -[_NSTableRowHeightStorage computeTableHeightForNumberOfRows:] + 62
28  com.apple.AppKit                0x00007fff87af3768 -[NSTableView _minimumFrameSize] + 74
29  com.apple.AppKit                0x00007fff87b10409 -[NSTableView tile] + 240
30  com.apple.AppKit                0x00007fff87b18570 -[NSTableView layout] + 110
31  com.apple.AppKit                0x00007fff87acbe65 -[NSView _layoutSubtreeHeedingRecursionGuard:] + 112
32  com.apple.CoreFoundation        0x00007fff890da4a6 __NSArrayEnumerate + 582
33  com.apple.AppKit                0x00007fff87acbfc6 -[NSView _layoutSubtreeHeedingRecursionGuard:] + 465
34  com.apple.CoreFoundation        0x00007fff890da4a6 __NSArrayEnumerate + 582
35  com.apple.AppKit                0x00007fff87acbfc6 -[NSView _layoutSubtreeHeedingRecursionGuard:] + 465
36  com.apple.CoreFoundation        0x00007fff890da4a6 __NSArrayEnumerate + 582
37  com.apple.AppKit                0x00007fff87acbfc6 -[NSView _layoutSubtreeHeedingRecursionGuard:] + 465
38  com.apple.CoreFoundation        0x00007fff890da4a6 __NSArrayEnumerate + 582
39  com.apple.AppKit                0x00007fff87acbfc6 -[NSView _layoutSubtreeHeedingRecursionGuard:] + 465
40  com.apple.CoreFoundation        0x00007fff890da4a6 __NSArrayEnumerate + 582
41  com.apple.AppKit                0x00007fff87acbfc6 -[NSView _layoutSubtreeHeedingRecursionGuard:] + 465
42  com.apple.CoreFoundation        0x00007fff890da4a6 __NSArrayEnumerate + 582
43  com.apple.AppKit                0x00007fff87acbfc6 -[NSView _layoutSubtreeHeedingRecursionGuard:] + 465
44  com.apple.CoreFoundation        0x00007fff890da4a6 __NSArrayEnumerate + 582
45  com.apple.AppKit                0x00007fff87acbfc6 -[NSView _layoutSubtreeHeedingRecursionGuard:] + 465
46  com.apple.AppKit                0x00007fff87acbcfe -[NSView layoutSubtreeIfNeeded] + 615
47  com.apple.AppKit                0x00007fff87ac74ac -[NSWindow(NSConstraintBasedLayout) layoutIfNeeded] + 201
48  com.apple.AppKit                0x00007fff879c10a8 _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 446
49  com.apple.AppKit                0x00007fff87f8c901 __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke_01208 + 46
50  com.apple.CoreFoundation        0x00007fff890a8417 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
51  com.apple.CoreFoundation        0x00007fff890a8381 __CFRunLoopDoObservers + 369
52  com.apple.CoreFoundation        0x00007fff890837b8 __CFRunLoopRun + 728
53  com.apple.CoreFoundation        0x00007fff890830e2 CFRunLoopRunSpecific + 290
54  com.apple.HIToolbox             0x00007fff88d7ceb4 RunCurrentEventLoopInMode + 209
55  com.apple.HIToolbox             0x00007fff88d7cc52 ReceiveNextEventCommon + 356
56  com.apple.HIToolbox             0x00007fff88d7cae3 BlockUntilNextEventMatchingListInMode + 62
57  com.apple.AppKit                0x00007fff879be533 _DPSNextEvent + 685
58  com.apple.AppKit                0x00007fff879bddf2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
59  com.apple.AppKit                0x00007fff879b51a3 -[NSApplication run] + 517
60  com.apple.AppKit                0x00007fff87959bd6 NSApplicationMain + 869
61  com.dayoneapp.dayone            0x0000000104e516e4 0x104e4f000 + 9956

// More threads, but nothing touching fonts or drawing code.
@atomkirk
Copy link

atomkirk commented Dec 9, 2013

It's an Mac app, so jailbroken doesn't apply.

@bjhomer
Copy link
Author

bjhomer commented Dec 9, 2013

Yeah, this is on Mac. x86_64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment