Crash in -[SPTableStructure(SPTableStructureDelegate) tableView:objectValueForTableColumn:row:] #2436

Open
dmoagx opened this Issue Mar 5, 2016 · 2 comments

Projects

None yet

2 participants

@dmoagx
Collaborator
dmoagx commented Mar 5, 2016

Pattern:

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000010ef99d8
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0x10ef99d8:
--> 
    __TEXT                 0000000100000000-00000001001d6000 [ 1880K] r-x/rwx SM=COW  /Applications/Sequel Pro.app/Contents/MacOS/Sequel Pro

Application Specific Information:
objc_msgSend() selector name: isNSString__


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x00007fff95cf24dd objc_msgSend + 29
1   com.sequelpro.SequelPro         0x000000010010acd6 -[SPTableStructure(SPTableStructureDelegate) tableView:objectValueForTableColumn:row:] + 1927
2   com.apple.AppKit                0x00007fff9af8fb41 -[NSTableView preparedCellAtColumn:row:] + 424
3   com.apple.AppKit                0x00007fff9af8f84c -[NSTableView _drawContentsAtRow:column:withCellFrame:] + 50
4   com.apple.AppKit                0x00007fff9af8f409 -[NSTableView drawRow:clipRect:] + 1678
5   com.apple.AppKit                0x00007fff9af8eaeb -[NSTableView drawRowIndexes:clipRect:] + 919
6   com.apple.AppKit                0x00007fff9af8d403 -[NSTableView drawRect:] + 1480
7   com.apple.AppKit                0x00007fff9ae12c22 -[NSView _drawRect:clip:] + 3626
8   com.apple.AppKit                0x00007fff9ae11501 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1873
9   com.apple.AppKit                0x00007fff9ae118de -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2862
10  com.apple.AppKit                0x00007fff9ae0f427 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 838
11  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
12  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
13  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
14  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
15  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
16  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
17  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
18  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
19  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
20  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
21  com.apple.AppKit                0x00007fff9ae107b1 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5840
22  com.apple.AppKit                0x00007fff9ae0ec0c -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 334
23  com.apple.AppKit                0x00007fff9ae0b1ef -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2449
24  com.apple.AppKit                0x00007fff9adc5971 -[NSView displayIfNeeded] + 1950
25  com.apple.AppKit                0x00007fff9adc519c -[NSWindow displayIfNeeded] + 232
26  com.apple.AppKit                0x00007fff9b5416da ___NSWindowGetDisplayCycleObserver_block_invoke6367 + 476
27  com.apple.AppKit                0x00007fff9b1880d6 __37+[NSDisplayCycle currentDisplayCycle]_block_invoke + 738
28  com.apple.QuartzCore            0x00007fff8d421b5d CA::Transaction::run_commit_handlers(CATransactionPhase) + 85
29  com.apple.QuartzCore            0x00007fff8d2bbc7c CA::Context::commit_transaction(CA::Transaction*) + 160
30  com.apple.QuartzCore            0x00007fff8d2bba24 CA::Transaction::commit() + 508
31  com.apple.QuartzCore            0x00007fff8d2ca917 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 71
32  com.apple.CoreFoundation        0x00007fff89e2ae37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
33  com.apple.CoreFoundation        0x00007fff89e2ada7 __CFRunLoopDoObservers + 391
34  com.apple.CoreFoundation        0x00007fff89e1c358 CFRunLoopRunSpecific + 328
35  com.apple.HIToolbox             0x00007fff9a7d4935 RunCurrentEventLoopInMode + 235
36  com.apple.HIToolbox             0x00007fff9a7d4677 ReceiveNextEventCommon + 184
37  com.apple.HIToolbox             0x00007fff9a7d45af _BlockUntilNextEventMatchingListInModeWithFilter + 71
38  com.apple.AppKit                0x00007fff9adc20ee _DPSNextEvent + 1067
39  com.apple.AppKit                0x00007fff9b18e943 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
40  com.apple.AppKit                0x00007fff9adb7fc8 -[NSApplication run] + 682
41  com.apple.AppKit                0x00007fff9ad3a520 NSApplicationMain + 1176
42  com.sequelpro.SequelPro         0x0000000100002284 start + 52

Reports:
http://log.sequelpro.com/view/6121

The disassembler says that +1927 is the isEqualToString: method call in

//...
            // Populate collation popup button
            for (NSDictionary *collation in collations)
            {
                NSString *collationName = [collation objectForKey:@"COLLATION_NAME"];

                [[tableColumn dataCell] addItemWithTitle:collationName];

                // If this matches the table's collation, draw in gray
                if (columnUsesTableDefaultEncoding && [collationName isEqualToString:tableCollation]) {
                    NSMenuItem *collationMenuItem = [(NSPopUpButtonCell *)[tableColumn dataCell] itemAtIndex:([[tableColumn dataCell] numberOfItems] - 1)];

                    NSAttributedString *itemString = [[[NSAttributedString alloc] initWithString:collationName attributes:menuAttributes] autorelease];

                    [collationMenuItem setAttributedTitle:itemString];
                }
            }
//...

That issue was probably introduced when I tried to fix the collation detection logic.

@dmoagx dmoagx added the Bug label Mar 5, 2016
@dmoagx dmoagx added this to the 1.1.2 milestone Apr 3, 2016
@dmoagx
Collaborator
dmoagx commented Apr 4, 2016

This issue still exists in 1.1.2

Crash reports show that there usually is a -[SPTableStructure(SPTableStructureLoading) loadTable:] on a background thread, which could also interfere with charset/collation data, so this might be a hard race condition.

@abhibeckert abhibeckert modified the milestone: 1.2, 1.1.2 Jun 7, 2016
@dmoagx
Collaborator
dmoagx commented Jun 25, 2016

Note:
Crash report comments indicate this usually happens when adding/removing a table column or index.

@dmoagx dmoagx added a commit that referenced this issue Jun 26, 2016
@dmoagx dmoagx Another attempt at #2436 197f50b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment