realm / realm-tasks

To Do app built with Realm, inspired by Clear for iOS
Other
369 stars 71 forks source link

Crashes when adding new item then input text from Mac app #344

Closed kishikawakatsumi closed 7 years ago

kishikawakatsumi commented 8 years ago

I reproduce on macOS 10.11.6 (15G1108).

2016-11-01 17:27:49.331 RealmTasks[4322:5277365] An uncaught exception was raised
2016-11-01 17:27:49.331 RealmTasks[4322:5277365] WARNING: NSTableView detected a rowView was requested from inside of the -heightOfRow delegate method. That is not supported!
2016-11-01 17:27:49.339 RealmTasks[4322:5277365] (
    0   CoreFoundation                      0x00007fff93761452 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff9560c73c objc_exception_throw + 48
    2   AppKit                              0x00007fff911235ec -[NSOutlineView didAddRowView:forRow:] + 0
    3   AppKit                              0x00007fff911fc123 -[NSTableView viewAtColumn:row:makeIfNecessary:] + 28
    4   AppKit                              0x00007fff9171fb7a -[NSTableViewCellMockElement childViewIsCellView:] + 135
    5   AppKit                              0x00007fff9171fbfa -[NSTableViewCellMockElement accessibilityChildrenAttribute] + 64
    6   AppKit                              0x00007fff9109871c NSAccessibilityGetObjectForAttributeUsingLegacyAPI + 392
    7   AppKit                              0x00007fff91096d90 _NSAccessibilityEntryPointValueForAttribute + 1879
    8   AppKit                              0x00007fff910963b2 NSAccessibilityChildren + 41
    9   AppKit                              0x00007fff910a09d4 -[NSObject(NSObjectAccessibilityAttributeAccessAdditions) accessibilityIndexOfChild:] + 14
    10  AppKit                              0x00007fff910a04aa -[NSObject(NSAccessibilityUIElementSpecifier) _accessibilityUIElementSpecifierForChild:registerIfNeeded:] + 143
    11  AppKit                              0x00007fff9109f5c4 -[NSObject(NSAccessibilityUIElementSpecifier) _accessibilityUIElementSpecifierRegisterIfNeeded:] + 84
    12  AppKit                              0x00007fff910c6eb4 NSAccessibilityPostNotificationForObservedElementWithUserInfo + 454
    13  AppKit                              0x00007fff91035e3b -[NSCell setObjectValue:] + 523
    14  AppKit                              0x00007fff91035be1 -[NSTextFieldCell setObjectValue:] + 88
    15  AppKit                              0x00007fff9103575c -[NSCell setStringValue:] + 101
    16  AppKit                              0x00007fff91043b9a -[NSCell stringValue] + 88
    17  RealmTasks                          0x0000000100016b37 _TFC10RealmTasks12ItemCellViewg4textSS + 55
    18  RealmTasks                          0x000000010000a013 _TFC10RealmTasksP33_7E198C33895350D918AF37C996AE505517PrototypeCellView9configurefCS_12ItemCellViewT_ + 67
    19  RealmTasks                          0x0000000100009dc9 _TFC10RealmTasks18ListViewController9tableViewfTCSo11NSTableView11heightOfRowSi_V12CoreGraphics7CGFloat + 249
    20  RealmTasks                          0x000000010000a382 _TToFC10RealmTasks18ListViewController9tableViewfTCSo11NSTableView11heightOfRowSi_V12CoreGraphics7CGFloat + 98
    21  AppKit                              0x00007fff911ba8c6 -[NSTableView _sendDelegateHeightOfRow:] + 167
    22  AppKit                              0x00007fff911ba668 -[NSTableView _uncachedRectHeightOfRow:] + 177
    23  AppKit                              0x00007fff911ffdd7 -[_NSTableRowHeightStorage noteHeightOfRowsWithIndexesChanged:] + 348
    24  AppKit                              0x00007fff913a61ce -[NSTableView noteHeightOfRowsWithIndexesChanged:] + 1062
    25  RealmTasks                          0x0000000100003f78 _TFFC10RealmTasks18ListViewControllerP33_7E198C33895350D918AF37C996AE505527updateTableViewHeightOfRowsFTGSqCSo10NSIndexSet__T_U_FT_T_ + 536
    26  RealmTasks                          0x0000000100023bdc _TFZFE10RealmTasksCSo6NSView7animateFT8durationSd14timingFunctionCSo21CAMediaTimingFunction10animationsFT_T_10completionGSqFT_T___T_U_FCSo18NSAnimationContextT_ + 172
    27  RealmTasks                          0x0000000100023cfc _TTRXFo_oCSo18NSAnimationContext_dT__XFdCb_dS__dT__ + 60
    28  AppKit                              0x00007fff9101d97f +[NSAnimationContext runAnimationGroup:completionHandler:] + 82
    29  RealmTasks                          0x0000000100023ac3 _TZFE10RealmTasksCSo6NSView7animatefT8durationSd14timingFunctionCSo21CAMediaTimingFunction10animationsFT_T_10completionGSqFT_T___T_ + 659
    30  RealmTasks                          0x0000000100024256 _TZFE10RealmTasksCSo6NSView7animatefT8durationSd14timingFunctionCSo21CAMediaTimingFunction10animationsFT_T__T_ + 118
    31  RealmTasks                          0x0000000100003cab _TFC10RealmTasks18ListViewControllerP33_7E198C33895350D918AF37C996AE505527updateTableViewHeightOfRowsfTGSqCSo10NSIndexSet__T_ + 235
    32  RealmTasks                          0x000000010000d093 _TFC10RealmTasks18ListViewController21cellViewDidChangeTextfCS_12ItemCellViewT_ + 259
    33  RealmTasks                          0x000000010000ddd9 _TTWuRxC10RealmSwift6Objectx10RealmTasks15ListPresentablerGCS1_18ListViewControllerx_S1_20ItemCellViewDelegateS1_FS4_21cellViewDidChangeTextfCS1_12ItemCellViewT_ + 57
    34  RealmTasks                          0x000000010001bcef _TFC10RealmTasks12ItemCellView20controlTextDidChangefCSo14NSNotificationT_ + 175
    35  RealmTasks                          0x000000010001bd5a _TToFC10RealmTasks12ItemCellView20controlTextDidChangefCSo14NSNotificationT_ + 58
    36  CoreFoundation                      0x00007fff936ecb1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
    37  CoreFoundation                      0x00007fff936ecaaf ___CFXRegistrationPost_block_invoke + 63
    38  CoreFoundation                      0x00007fff936eca27 _CFXRegistrationPost + 407
    39  CoreFoundation                      0x00007fff936ec792 ___CFXNotificationPost_block_invoke + 50
    40  CoreFoundation                      0x00007fff936a9542 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
    41  CoreFoundation                      0x00007fff936a8795 _CFXNotificationPost + 693
    42  Foundation                          0x00007fff870b317a -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
    43  RealmTasks                          0x000000010001fa94 _TFC10RealmTasksP33_0A5C999B4A8DC5E486DAC81A84970E4213ItemTextField13textDidChangefCSo14NSNotificationT_ + 84
    44  RealmTasks                          0x000000010001fb1a _TToFC10RealmTasksP33_0A5C999B4A8DC5E486DAC81A84970E4213ItemTextField13textDidChangefCSo14NSNotificationT_ + 58
    45  CoreFoundation                      0x00007fff936ecb1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
    46  CoreFoundation                      0x00007fff936ecaaf ___CFXRegistrationPost_block_invoke + 63
    47  CoreFoundation                      0x00007fff936eca27 _CFXRegistrationPost + 407
    48  CoreFoundation                      0x00007fff936ec792 ___CFXNotificationPost_block_invoke + 50
    49  CoreFoundation                      0x00007fff936a9542 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
    50  CoreFoundation                      0x00007fff936a8795 _CFXNotificationPost + 693
    51  Foundation                          0x00007fff870b317a -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
    52  AppKit                              0x00007fff911b3267 -[NSTextView(NSSharing) didChangeText] + 345
    53  AppKit                              0x00007fff911b05e1 -[NSTextView insertText:replacementRange:] + 2674
    54  AppKit                              0x00007fff911af6e0 -[NSTextInputContext(NSInputContext_WithCompletion) insertText:replacementRange:completionHandler:] + 79
    55  AppKit                              0x00007fff911af683 __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2250 + 127
    56  AppKit                              0x00007fff911af5f5 -[NSTextInputContext do_HandleTSMEvent_insertFixLenTextLoop:whileCondition:dispatchWorkEach:afterEachInsertText:continuation:] + 181
    57  AppKit                              0x00007fff918bbc2f -[NSTextInputContext tryHandleTSMEvent_insertFixLenText_withContext:dispatchCondition:setupForDispatch:nestedWorkaroundCondition:nestedWorkaroundDispatchWork:loopCondition:dispatchWorkEach:afterEachInsertText:continuation:] + 428
    58  AppKit                              0x00007fff911af053 __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke176 + 4253
    59  AppKit                              0x00007fff911adec8 __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2 + 95
    60  AppKit                              0x00007fff911ade3b -[NSTextInputContext tryHandleTSMEvent_HasMarkedText_withDispatchCondition:dispatchWork:continuation:] + 101
    61  AppKit                              0x00007fff911adb2b -[NSTextInputContext handleTSMEvent:completionHandler:] + 3173
    62  AppKit                              0x00007fff911ace5a _NSTSMEventHandler + 324
    63  HIToolbox                           0x00007fff8bc1f7be _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1231
    64  HIToolbox                           0x00007fff8bc1ec48 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 404
    65  HIToolbox                           0x00007fff8bc1eaab SendEventToEventTargetWithOptions + 43
    66  HIToolbox                           0x00007fff8bc73f7d SendTSMEvent_WithCompletionHandler + 417
    67  HIToolbox                           0x00007fff8bc7446c __SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler_block_invoke + 400
    68  HIToolbox                           0x00007fff8bc742bf __SendFilterTextEvent_WithCompletionHandler_block_invoke + 189
    69  HIToolbox                           0x00007fff8bc73fcd SendTSMEvent_WithCompletionHandler + 497
    70  HIToolbox                           0x00007fff8bc73daf SendFilterTextEvent_WithCompletionHandler + 236
    71  HIToolbox                           0x00007fff8bc73a88 SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler + 284
    72  HIToolbox                           0x00007fff8bc73838 __utDeliverTSMEvent_WithCompletionHandler_block_invoke_2 + 296
    73  HIToolbox                           0x00007fff8bc736dc __utDeliverTSMEvent_WithCompletionHandler_block_invoke + 437
    74  HIToolbox                           0x00007fff8bc734cf TSMKeyEvent_WithCompletionHandler + 721
    75  HIToolbox                           0x00007fff8bc731c5 __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_4 + 251
    76  HIToolbox                           0x00007fff8bc73033 __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_3 + 325
    77  HIToolbox                           0x00007fff8bc72d71 __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_2 + 261
    78  HIToolbox                           0x00007fff8bc72b3a __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke + 253
    79  HIToolbox                           0x00007fff8bc721f0 TSMProcessRawKeyEventWithOptionsAndCompletionHandler + 3199
    80  AppKit                              0x00007fff911acd0b __61-[NSTextInputContext _handleEvent:options:completionHandler:]_block_invoke955 + 131
    81  AppKit                              0x00007fff911ab9ed -[NSTextInputContext tryTSMProcessRawKeyEvent:dispatchCondition:setupForDispatch:furtherCondition:dispatchWork:continuation:] + 131
    82  AppKit                              0x00007fff911ab6e7 -[NSTextInputContext _handleEvent:options:completionHandler:] + 1266
    83  AppKit                              0x00007fff911ab1ba -[NSTextInputContext handleEvent:] + 109
    84  AppKit                              0x00007fff911ab0c3 -[NSView interpretKeyEvents:] + 204
    85  AppKit                              0x00007fff911aaeee -[NSTextView keyDown:] + 658
    86  AppKit                              0x00007fff917d4b15 -[NSWindow _reallySendEvent:isDelayedEvent:] + 2108
    87  AppKit                              0x00007fff91213539 -[NSWindow sendEvent:] + 517
    88  AppKit                              0x00007fff9119416a -[NSApplication sendEvent:] + 4382
    89  AppKit                              0x00007fff90ffadf2 -[NSApplication run] + 796
    90  AppKit                              0x00007fff90fc4368 NSApplicationMain + 1176
    91  RealmTasks                          0x0000000100028324 main + 84
    92  libdyld.dylib                       0x00007fff91fde5ad start + 1
)
stel commented 7 years ago

I was able to reproduce that issue only with VoiceOver turned on. According to a stack trace NSCell.stringValue getter calls the setter which generates some accessibility API notification that leads to querying table view cell or row view that is not supported in heightOfRow delegate method.

The easiest workaround could be overriding NSCell.stringValue getter in custom subclass.