vieten / sequel-pro

Automatically exported from code.google.com/p/sequel-pro
Other
0 stars 0 forks source link

SP crashes/hangs after killing a query #461

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open a connection
2. Open a second connection (same db) and select a table and show the table 
content
3. Go to first connection and kill the Query process of the second connection
4. Go to second connection and press ⌘R

What is the expected output? What do you see instead?
Sometimes an error alert occurs but then SP/the second window either crashes or 
hangs. As far 
as I could investigate this occurs only if a table was selected and the Content 
pane is active

Please use labels and text to provide additional information.
Mac OSX 10.6.2 SP rev. 1510

Cheers,
--Hans

Original issue reported on code.google.com by bibiko@gmail.com on 13 Nov 2009 at 3:25

GoogleCodeExporter commented 9 years ago
Hans - perhaps I've fixed this in the query cancellation improvements, as I 
can't replicate this any more!  I did 
notice that partial loads weren't correctly reported so have fixed that in 
r1533, but I can't get any crashes with 
two windows open to the same server, even with a refresh.  Do you still see 
this in the latest builds?

(Tried query kills and connection kills)

Original comment by rowanb@gmail.com on 16 Nov 2009 at 11:39

GoogleCodeExporter commented 9 years ago
Hmm, for me SP crashes always with the attached report. Maybe it's related to 
the spinner(?)

--Hans

Identifier:      com.google.code.sequel-pro
Version:         0.9.6 (1536)
Code Type:       X86 (Native)
Parent Process:  launchd [150]

Date/Time:       2009-11-17 10:50:07.852 +0100
OS Version:      Mac OS X 10.6.2 (10C540)
Report Version:  6

Interval Since Last Report:          12325 sec
Crashes Since Last Report:           3
Per-App Interval Since Last Report:  84 sec
Per-App Crashes Since Last Report:   3
Anonymous UUID:                      EFDDAFF1-A233-4FB8-B18D-6D700711C081

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000010
Crashed Thread:  10

Thread 0:  Dispatch queue: com.apple.main-thread
0   com.apple.CoreGraphics          0x978c3253 aa_render_shape + 2520
1   libRIP.A.dylib                  0x9895d9da ripr_Coverage + 1570
2   libRIP.A.dylib                  0x9895b684 ripc_GetClipState + 3779
3   libRIP.A.dylib                  0x9895a514 ripc_GetRenderingState + 151
4   libRIP.A.dylib                  0x9897333d ripc_DrawImages + 125
5   com.apple.CoreGraphics          0x978d3d9a CGContextDrawImages + 208
6   com.apple.coreui                0x911780d2 
CUIRenderer::DrawWindowFrameDark(CUIDescriptor const*) + 
4738
7   com.apple.coreui                0x9117ac33 CUIRenderer::Draw(CGRect, 
CGContext*, __CFDictionary const*, 
__CFDictionary const**) + 5287
8   com.apple.AppKit                0x981964a0 _NSDrawThemeBackground + 1157
9   com.apple.AppKit                0x98195f68 -[NSThemeFrame 
_drawUnifiedToolbar:] + 972
10  com.apple.AppKit                0x9819562e -[NSThemeFrame _drawTitleBar:] + 
599
11  com.apple.AppKit                0x981953cd -[NSThemeFrame 
_drawFrameInterior:clip:] + 107
12  com.apple.AppKit                0x9819535a -[NSThemeFrame drawFrame:] + 1123
13  com.apple.AppKit                0x98194e2e -[NSFrameView drawRect:] + 755
14  com.apple.AppKit                0x98194534 -[NSThemeFrame drawRect:] + 111
15  com.apple.AppKit                0x98193b6c -[NSView _drawRect:clip:] + 3721
16  com.apple.AppKit                0x98191238 -[NSView 
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForV
iew:topView:] + 2217
17  com.apple.AppKit                0x981907cb -[NSThemeFrame 
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForV
iew:topView:] + 265
18  com.apple.AppKit                0x9818d111 -[NSView 
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 3309
19  com.apple.AppKit                0x980edd6e -[NSView displayIfNeeded] + 818
20  com.apple.AppKit                0x980b7094 -[NSWindow displayIfNeeded] + 204
21  com.apple.AppKit                0x980e85aa _handleWindowNeedsDisplay + 696
22  com.apple.CoreFoundation        0x94c8f892 __CFRunLoopDoObservers + 1186
23  com.apple.CoreFoundation        0x94c4c18d __CFRunLoopRun + 557
24  com.apple.CoreFoundation        0x94c4b864 CFRunLoopRunSpecific + 452
25  com.apple.CoreFoundation        0x94c4b691 CFRunLoopRunInMode + 97
26  com.apple.HIToolbox             0x95170f0c RunCurrentEventLoopInMode + 392
27  com.apple.HIToolbox             0x95170cc3 ReceiveNextEventCommon + 354
28  com.apple.HIToolbox             0x95170b48 
BlockUntilNextEventMatchingListInMode + 81
29  com.apple.AppKit                0x980beac5 _DPSNextEvent + 847
30  com.apple.AppKit                0x980be306 -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 156
31  com.apple.AppKit                0x9808049f -[NSApplication run] + 821
32  com.apple.AppKit                0x98078535 NSApplicationMain + 574
33  com.google.code.sequel-pro      0x000028c8 main + 30 (main.m:30)
34  com.google.code.sequel-pro      0x0000287e start + 54

Thread 1:  Dispatch queue: com.apple.libdispatch-manager
0   libSystem.B.dylib               0x930380ea kevent + 10
1   libSystem.B.dylib               0x93038804 _dispatch_mgr_invoke + 215
2   libSystem.B.dylib               0x93037cc3 _dispatch_queue_invoke + 163
3   libSystem.B.dylib               0x93037a68 _dispatch_worker_thread2 + 234
4   libSystem.B.dylib               0x930374f1 _pthread_wqthread + 390
5   libSystem.B.dylib               0x93037336 start_wqthread + 30

Thread 2:
0   libSystem.B.dylib               0x93037182 __workq_kernreturn + 10
1   libSystem.B.dylib               0x93037718 _pthread_wqthread + 941
2   libSystem.B.dylib               0x93037336 start_wqthread + 30

Thread 3:  JavaScriptCore: FastMalloc scavenger
0   libSystem.B.dylib               0x9303f806 __semwait_signal + 10
1   libSystem.B.dylib               0x9303f4c2 _pthread_cond_wait + 1191
2   libSystem.B.dylib               0x93041158 pthread_cond_wait$UNIX2003 + 73
3   com.apple.JavaScriptCore        0x95d54276 
WTF::TCMalloc_PageHeap::scavengerThread() + 614
4   libSystem.B.dylib               0x9303ee42 thread_start + 34

Thread 4:
0   libSystem.B.dylib               0x93037182 __workq_kernreturn + 10
1   libSystem.B.dylib               0x93037718 _pthread_wqthread + 941
2   libSystem.B.dylib               0x93037336 start_wqthread + 30

Thread 5:
0   libSystem.B.dylib               0x9301193a semaphore_timedwait_signal_trap + 
10
1   libSystem.B.dylib               0x9303f445 _pthread_cond_wait + 1066
2   libSystem.B.dylib               0x9306e028 
pthread_cond_timedwait_relative_np + 47
3   com.apple.CoreVideo             0x9681815e CVDisplayLink::waitUntil(unsigned 
long long) + 386
4   com.apple.CoreVideo             0x96816fd7 CVDisplayLink::runIOThread() + 747
5   com.apple.CoreVideo             0x96816cd0 startIOThread(void*) + 156
6   libSystem.B.dylib               0x9303efbd _pthread_start + 345
7   libSystem.B.dylib               0x9303ee42 thread_start + 34

Thread 6:
0   libSystem.B.dylib               0x9303f806 __semwait_signal + 10
1   libSystem.B.dylib               0x9303f4c2 _pthread_cond_wait + 1191
2   libSystem.B.dylib               0x93041158 pthread_cond_wait$UNIX2003 + 73
3   com.apple.CoreVideo             0x968170c8 CVDisplayLink::runIOThread() + 988
4   com.apple.CoreVideo             0x96816cd0 startIOThread(void*) + 156
5   libSystem.B.dylib               0x9303efbd _pthread_start + 345
6   libSystem.B.dylib               0x9303ee42 thread_start + 34

Thread 7:
0   libSystem.B.dylib               0x93037182 __workq_kernreturn + 10
1   libSystem.B.dylib               0x93037718 _pthread_wqthread + 941
2   libSystem.B.dylib               0x93037336 start_wqthread + 30

Thread 8:
0   libSystem.B.dylib               0x93037182 __workq_kernreturn + 10
1   libSystem.B.dylib               0x93037718 _pthread_wqthread + 941
2   libSystem.B.dylib               0x93037336 start_wqthread + 30

Thread 9:
0   libSystem.B.dylib               0x9303f806 __semwait_signal + 10
1   libSystem.B.dylib               0x9306b441 nanosleep$UNIX2003 + 188
2   libSystem.B.dylib               0x9306b37f usleep$UNIX2003 + 61
3   com.google.code.sequel-pro      0x000c1661 -[YRKSpinningProgressIndicator 
animateInBackgroundThread] + 210 (YRKSpinningProgressIndicator.m:182)
4   com.apple.Foundation            0x931cc8d8 -[NSThread main] + 45
5   com.apple.Foundation            0x931cc888 __NSThread__main__ + 1499
6   libSystem.B.dylib               0x9303efbd _pthread_start + 345
7   libSystem.B.dylib               0x9303ee42 thread_start + 34

Thread 10 Crashed:
0   libobjc.A.dylib                 0x9927b964 prepareForMethodLookup + 71
1   libobjc.A.dylib                 0x9927cc17 lookUpMethod + 86
2   libobjc.A.dylib                 0x99274367 _class_lookupMethodAndLoadCache + 
40
3   libobjc.A.dylib                 0x99273f13 objc_msgSend + 83
4   com.google.code.sequel-pro      0x0007c6d8 -[SPTableData 
updateInformationForCurrentTable] + 144 
(SPTableData.m:271)
5   com.google.code.sequel-pro      0x0007c1d0 -[SPTableData columnNames] + 130 
(SPTableData.m:149)
6   com.google.code.sequel-pro      0x00015d5b -[TableContent loadTable:] + 2092 
(TableContent.m:253)
7   com.google.code.sequel-pro      0x000199a8 -[TableContent reloadTableTask] + 
187 
(TableContent.m:912)
8   com.apple.Foundation            0x931cc8d8 -[NSThread main] + 45
9   com.apple.Foundation            0x931cc888 __NSThread__main__ + 1499
10  libSystem.B.dylib               0x9303efbd _pthread_start + 345
11  libSystem.B.dylib               0x9303ee42 thread_start + 34

Thread 11:
0   libSystem.B.dylib               0x9303f806 __semwait_signal + 10
1   libSystem.B.dylib               0x9306b441 nanosleep$UNIX2003 + 188
2   libSystem.B.dylib               0x9306b37f usleep$UNIX2003 + 61
3   com.apple.AppKit                0x982281ed -[NSUIHeartBeat 
_heartBeatThread:] + 2039
4   com.apple.Foundation            0x931cc8d8 -[NSThread main] + 45
5   com.apple.Foundation            0x931cc888 __NSThread__main__ + 1499
6   libSystem.B.dylib               0x9303efbd _pthread_start + 345
7   libSystem.B.dylib               0x9303ee42 thread_start + 34

Original comment by bibiko@gmail.com on 17 Nov 2009 at 9:54

GoogleCodeExporter commented 9 years ago
The trace shows thread 10 crashing within SPTableData 
updateInformationForCurrentTable, which is a rather 
short method, with an objc_msgSend error possibly caused by something which 
isn't a valid object or already 
released - I'm not entirely sure.

I still can't reproduce this, which is very irritating.  Will try more later.

Original comment by rowanb@gmail.com on 17 Nov 2009 at 10:44

GoogleCodeExporter commented 9 years ago
Ben provided a clue to replicate this - the connection has to be to a 5.1.x 
server.  Killing a query even while no 
query is active (!) produces the error you mention, while if the connection is 
killed it all recovers fine.

Will look at this tonight - sounds like 5.1.x is doing something nasty...

Original comment by rowanb@gmail.com on 17 Nov 2009 at 11:18

GoogleCodeExporter commented 9 years ago

Original comment by rowanb@gmail.com on 17 Nov 2009 at 1:54

GoogleCodeExporter commented 9 years ago
Mmm.  I can't work this one out, so I'm unclaiming it for now.

The root of the problem appears to be that running a KILL QUERY on MySQL 5.1 
kills the *next* query if no 
query is currently active.  So it's easily testable by just opening two 
windows, using the process manager to 
kill a query in one of them *even with no query active*, and then try to 
perform an action in that window.

Doing this on the content view produces a consistent crash in SPTableData line 
271, but I can't figure out why. 
Table name is being returned correctly and it doesn't seem to be descending 
into informationForTable:, and 
self looks valid.

I'm not sure we can fix the query kill behaviour, but there is evidently a weak 
point somewhere where the 
results of a query aren't being checked correctly, or don't bail correctly, but 
I can't figure out where.  I do get 
a dialog before it crashes though!

Original comment by rowanb@gmail.com on 18 Nov 2009 at 10:54

GoogleCodeExporter commented 9 years ago
An attempt to fix this was committed in revision 1555. It would be appreciated 
if the fix can be tested.

Cheers

Stuart

Original comment by stuart02 on 20 Nov 2009 at 1:43

GoogleCodeExporter commented 9 years ago
Hi Stuart,

it seems that r1555 fixed that issue. I tried several ways of killing the 
query/connection and SP always reacted as 
expected :)

Thanks!
--Hans

Original comment by bibiko@gmail.com on 20 Nov 2009 at 7:33