New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

2 participants
@dmoagx
Member

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

This comment has been minimized.

Show comment
Hide comment
@dmoagx

dmoagx Apr 4, 2016

Member

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.

Member

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 milestones: 1.2, 1.1.2 Jun 7, 2016

@dmoagx

This comment has been minimized.

Show comment
Hide comment
@dmoagx

dmoagx Jun 25, 2016

Member

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

Member

dmoagx commented Jun 25, 2016

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

dmoagx added a commit that referenced this issue Jun 26, 2016

@abhibeckert abhibeckert added this to Potential in Sequel Pro 1.2 Feb 2, 2017

@abhibeckert abhibeckert moved this from Planned to In Progress in Sequel Pro 1.2 Feb 2, 2017

@abhibeckert abhibeckert moved this from In Progress to Done in Sequel Pro 1.2 Mar 15, 2017

@abhibeckert abhibeckert removed this from the 1.2 milestone Mar 27, 2017

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