Skip to content
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

EXC_BAD_ACCESS Crash on El Capitan when changing database #2513

Open
Marco-Kawon opened this issue Jun 3, 2016 · 5 comments
Open

EXC_BAD_ACCESS Crash on El Capitan when changing database #2513

Marco-Kawon opened this issue Jun 3, 2016 · 5 comments

Comments

@Marco-Kawon
Copy link

Hey there,
I have lots of crashes when switching to a different database (via the db-dropdown menu in left menu)

This happens randomly and not always, but I work with your great tool daily and have about 20 crashes per day because I have to switch Databases very often on production machines.

Here a bunch of crashlogs from the last 2 days:

Sequel Pro_2016-06-03-103410_Marcos-iMac.crash.txt
Sequel Pro_2016-06-01-124656_Marcos-iMac.crash.txt
Sequel Pro_2016-06-01-160026_Marcos-iMac.crash.crash.txt
Sequel Pro_2016-06-01-163325_Marcos-iMac.crash.txt
Sequel Pro_2016-06-01-164200_Marcos-iMac.crash.txt
Sequel Pro_2016-06-01-165233_Marcos-iMac.crash.txt
Sequel Pro_2016-06-01-170008_Marcos-iMac.crash.txt
Sequel Pro_2016-06-02-094843_Marcos-iMac.crash.txt
Sequel Pro_2016-06-03-103316_Marcos-iMac.crash.txt

@dmoagx
Copy link
Member

dmoagx commented Jun 3, 2016

Hm, this seems to be
http://log.sequelpro.com/view/5249

The interesting part seems to be in this background thread which is visible in all traces:

Thread 27:: SPDatabaseDocument database and table load task
0   libsystem_malloc.dylib          0x00007fff82f95ac2 get_tiny_previous_free_msize + 13
1   libsystem_malloc.dylib          0x00007fff82f97888 szone_free + 1263
2   com.apple.CoreFoundation        0x00007fff92a4fef5 CFRelease + 1397
3   com.apple.CoreFoundation        0x00007fff92aef12c -[__NSArrayM removeAllObjects] + 396
4   com.sequelpro.SequelPro         0x00000001000584b3 -[SPTablesList updateTables:] + 544
5   com.sequelpro.SequelPro         0x00000001000469c5 -[SPDatabaseDocument _selectDatabaseAndItem:] + 454
6   com.apple.Foundation            0x00007fff8b4bad64 __NSThread__start__ + 1351
7   libsystem_pthread.dylib         0x00007fff895c199d _pthread_body + 131
8   libsystem_pthread.dylib         0x00007fff895c191a _pthread_start + 168
9   libsystem_pthread.dylib         0x00007fff895bf351 thread_start + 13

updateTables: is marked as an IBAction, yet it is still called from a background thread (and contains some thread-aware code)...

@dmoagx dmoagx added the Bug label Jun 3, 2016
@dmoagx
Copy link
Member

dmoagx commented Jun 3, 2016

Sidenote:

There is another issue here: We don't update the table row count after removing all rows in updateTables: which can cause nasty exceptions if updateTables: takes some time and the user scrolls the table list in the mean time:

2016-06-03 20:13:01.056 Sequel Pro[60414:303] Controller already shown
2016-06-03 20:13:01.130 Sequel Pro[60414:303] *** -[__NSArrayM objectAtIndex:]: index 9 beyond bounds for empty array
2016-06-03 20:13:01.133 Sequel Pro[60414:303] (
    0   CoreFoundation                      0x00007fff83f0725c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff82a52e75 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff83de54f5 -[__NSArrayM objectAtIndex:] + 245
    3   Sequel Pro                          0x000000010009f1b8 NSArrayObjectAtIndex + 40
    4   Sequel Pro                          0x00000001000aa781 -[SPTablesList tableView:willDisplayCell:forTableColumn:row:] + 193
    5   AppKit                              0x00007fff857a4146 -[NSTableView preparedCellAtColumn:row:] + 1437
    6   AppKit                              0x00007fff857a3a5e -[NSTableView _drawContentsAtRow:column:withCellFrame:] + 44
    7   AppKit                              0x00007fff857a3793 -[NSTableView drawRow:clipRect:] + 1629
    8   AppKit                              0x00007fff857a2fed -[NSTableView drawRowIndexes:clipRect:] + 776
    9   AppKit                              0x00007fff8566c331 -[NSTableView drawRect:] + 1484
    10  AppKit                              0x00007fff8564504f -[NSView _drawRect:clip:] + 3748
    11  AppKit                              0x00007fff856438c4 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1799
    12  AppKit                              0x00007fff85643ca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
    13  AppKit                              0x00007fff85643ca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
    14  AppKit                              0x00007fff85643ca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
    15  AppKit                              0x00007fff85643ca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
    16  AppKit                              0x00007fff85643ca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
    17  AppKit                              0x00007fff85641706 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 841
    18  AppKit                              0x00007fff85642bc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
    19  AppKit                              0x00007fff85642bc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
    20  AppKit                              0x00007fff85642bc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
    21  AppKit                              0x00007fff85642bc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
    22  AppKit                              0x00007fff85642bc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
    23  AppKit                              0x00007fff85642bc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
    24  AppKit                              0x00007fff85642bc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
    25  AppKit                              0x00007fff85640eb1 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 314
    26  AppKit                              0x00007fff8563de9f -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2828
    27  AppKit                              0x00007fff8561d2da -[NSView displayIfNeeded] + 1680
    28  AppKit                              0x00007fff8568274e _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 884
    29  AppKit                              0x00007fff85c58061 __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke1331 + 46
    30  CoreFoundation                      0x00007fff83e37d67 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    31  CoreFoundation                      0x00007fff83e37cd7 __CFRunLoopDoObservers + 391
    32  CoreFoundation                      0x00007fff83e293b8 __CFRunLoopRun + 776
    33  CoreFoundation                      0x00007fff83e28e75 CFRunLoopRunSpecific + 309
    34  HIToolbox                           0x00007fff840daa0d RunCurrentEventLoopInMode + 226
    35  HIToolbox                           0x00007fff840da7b7 ReceiveNextEventCommon + 479
    36  HIToolbox                           0x00007fff840da5bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
    37  AppKit                              0x00007fff854e624e _DPSNextEvent + 1434
    38  AppKit                              0x00007fff854e589b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
    39  AppKit                              0x00007fff854d999c -[NSApplication run] + 553
    40  AppKit                              0x00007fff854c4783 NSApplicationMain + 940
    41  Sequel Pro                          0x0000000100002112 main + 34
    42  Sequel Pro                          0x0000000100001844 start + 52
    43  ???                                 0x0000000000000003 0x0 + 3
)

@dmoagx
Copy link
Member

dmoagx commented Jun 3, 2016

-[SPTablesList updateTables:] + 544 in 1.1.2 is the [tables removeAllObjects]; call btw.

@Marco-Kawon
Copy link
Author

No more crashes since a week with the latest nightly-build, which includes your fix #d132147

Thanks for that, much appreciated!

@dmoagx
Copy link
Member

dmoagx commented Aug 18, 2016

Thanks for your feedback.

@dmoagx dmoagx added this to the 1.2 milestone Aug 18, 2016
@abhibeckert abhibeckert added this to Done in Sequel Pro 1.2 Feb 2, 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
Projects
Development

No branches or pull requests

3 participants