Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Crashs periodically on Lion #28

yyyc514 opened this Issue · 12 comments

4 participants


Another person with same issue:

Always the same stack track of NSTokenField respondsToSelector:... spoke with Allan Osgard and he said Textmate doesn't even use a NSTokenField and since AckMate did there is a good chance the crash could fall on AckMate's shoulders... can anyone else seeing this problem please jump in here.

My log:

Process:         TextMate [34526]
Path:            /Applications/
Identifier:      com.macromates.textmate
Version:         1.5.10 (1631)
Code Type:       X86 (Native)
Parent Process:  launchd [179]

Date/Time:       2011-08-31 23:33:14.336 -0400
OS Version:      Mac OS X 10.7.1 (11B2118)
Report Version:  9

Interval Since Last Report:          14321 sec
Crashes Since Last Report:           1
Per-App Interval Since Last Report:  14313 sec
Per-App Crashes Since Last Report:   1
Anonymous UUID:                      005762D1-9097-4963-A23D-6411890272E0

Crashed Thread:  0  Dispatch queue:

Exception Codes: KERN_INVALID_ADDRESS at 0x00000000d0141aa1

VM Regions Near 0xd0141aa1:
    CG shared images       00000000c2b47000-00000000c2b4f000 [   32K] r--/r-- SM=SHM  
    Submap                 00000000ffff0000-00000000ffff2000          r-x/r-x process-only submap

Application Specific Information:
objc_msgSend() selector name: respondsToSelector:
objc[34526]: garbage collection is OFF

Thread 0 Crashed:: Dispatch queue:
0   libobjc.A.dylib                 0x96406d47 objc_msgSend + 23
1                0x977302f1 -[NSTokenField respondsToSelector:] + 416
2                0x97731bc9 -[NSTokenFieldCell _attributedStringForRepresentedObjects:] + 105
3                0x97735d46 -[NSTokenFieldCell _unformattedAttributedStringValue:] + 103
4                0x970e7e5c -[NSCell _attributedStringValue:invalid:] + 269
5                0x970e7d20 -[NSCell attributedStringValue] + 172
6                0x970f5a5b __NSGetStringAndAttributesFromTextCell + 86
7                0x970f47a9 _NSDrawTextCell + 257
8                0x970f3f53 -[NSTextFieldCell drawInteriorWithFrame:inView:] + 776
9                0x970f3c40 -[NSTextFieldCell drawWithFrame:inView:] + 893
10                0x970eba0c -[NSControl drawRect:] + 373
11                0x970b497a -[NSView _drawRect:clip:] + 3717
12                0x970e46e3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1958
13                0x970b22db -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 708
14                0x970b3448 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5169
15                0x970b3448 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5169
16                0x970b3448 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5169
17                0x970b3448 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5169
18                0x970b3448 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5169
19                0x970b18e5 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 259
20                0x970acf59 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 4817
21                0x970a5e5d -[NSView displayIfNeeded] + 1365
22                0x970a2c35 -[NSWindow displayIfNeeded] + 316
23                0x970a572c _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 804
24        0x9be4faad _runLoopObserverWithBlockContext + 29
26        0x9be1bfbd __CFRunLoopDoObservers + 413
27        0x9bdee994 __CFRunLoopRun + 1044
28        0x9bdee1ec CFRunLoopRunSpecific + 332
29        0x9bdee098 CFRunLoopRunInMode + 120
30             0x93e37487 RunCurrentEventLoopInMode + 318
31             0x93e3ecee ReceiveNextEventCommon + 168
32             0x93e3ec32 BlockUntilNextEventMatchingListInMode + 88
33                0x970656c0 _DPSNextEvent + 678
34                0x97064f2d -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 113
35                0x9706129f -[NSApplication run] + 904
36                0x972f4928 NSApplicationMain + 1054
37  com.macromates.textmate         0x0012e4f2 main + 168
38  com.macromates.textmate         0x0000610e _start + 216
39  com.macromates.textmate         0x00006035 start + 41

Is there any more context you can add to this, such as what you're doing just prior to the crash?


It feels very repetitive (at least once day?) but I can't ever quite pin down what I was doing at the time... perhaps trying to close a project or switch to or from Textmate (or to or from one Textmate window)... I did glance at the source... could it be that perhaps cleanupImmediately is not working properly? Thinking specifically of notePreferences and line 154... perhaps on Lion the window or field is deconstructed earlier than you're expecting so it's already gone at the point you're trying to get the value from it?

Just a very wild guess...


I wish it was as straight forward as that... notePreferences isn't anywhere in the call stack so it's not involved.

What the stack trace seems to be saying is that an on-screen cell is trying draw but its associated control has been deallocated. As I type this out, I'm beginning to wonder if it's the window's field editor.

I'll dig around a bit.

  1. Open a folder in Textmate
  2. Open AckMate window, run search for something (must have results I think)
  3. Click on Textmate window for folder (bring it back to focus)
  4. Close window
  5. Textmate crashes

I can reproduce 100% of the time.


100% of the time it crashes, every time for me. Fresh install using Lion


Protocol, can you reproduce?


I haven't been able to reproduce but I've been running 10.7.2 (pre-release) to verify that one of my open bugs with apple was, in fact, fixed.

I'll be revving back to 10.7.1 later today.



May be a different problem, i'm not able to get a stack trace, it doesn't actually crash, it just beach-balls indefinitely. I'm able to do this every time by following the steps you outlined above 100% of the time. If the app does ever become responsive again (rarely) then clicking on the AckMate window and clicking back to text mate gives me another beach-ball.


Ping, this is still driving me nuts. Any news?


Found it.

Got distracted by the fact that it didn't happen for me if I used the keyboard to switch back to the main window.

Ended up missing a dangling garbage pointer to a delegate during window tear-down - surprised it wasn't a source of crashes on earlier OSX releases really...

Checked in the fix, won't be doing a release until I have a chance to review other possible changes (like the stupid UTF8 thing).



For those looking for a build with this fix:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.