EXC_BAD_INSTRUCTION (SIGILL) at random during use of app. Bug in AppKit?
I'm currently testing a new version of an app of mine on OSX 10.5 An user reported some weird crashes during use of the application, sadly not reproducible by me. At first sight it seems to happen randomly, once he had the crash while opening an NSOpenPanel and once during focusing an NSTextField and once during NSView switch in a parent view.
If you have any idea which area I should look at it would be greatly appreciated! I'm completely lost here.
App is compiled in XCode 3.2.1 with SDK 10.5 and targetted at 10.5
Please note the issue isn't visible for hundreds of customers but for at least one it is. It's not in [openNZBFileButtonClick] only, the stacktraces seem to appear randomly even when clicking in an NSTextField once.
He send me these crashes:
Crash 1
Process: NZBVortex [43622]
Path: /Users/cero/Downloads/NZBVortex.app/Contents/MacOS/NZBVortex
Identifier: com.NZBVortex.NZBVortex
Version: 0.5.5 (0.5.5)
Code Type: X86-64 (Native)
开发者_开发问答 Parent Process: launchd [97]
Interval Since Last Report: 1951 sec
Crashes Since Last Report: 1
Per-App Interval Since Last Report: 1858 sec
Per-App Crashes Since Last Report: 1
Date/Time: 2010-03-23 23:43:49.671 +0100
OS Version: Mac OS X 10.5.8 (9L31a)
Report Version: 6
Anonymous UUID: 98AB0386-590B-4E0D-B7AC-3F7AA4E7238E
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Crashed Thread: 0
Application Specific Information:
objc[43622]: alt handlers in objc runtime are buggy!
- Hide quoted text -
Thread 0 Crashed:
0 libobjc.A.dylib 0x00007fff82baef6e _objc_fatal + 238
1 libobjc.A.dylib 0x00007fff82bb2ea4
objc_addExceptionHandler + 302
2 com.apple.CoreFoundation 0x00007fff842b1090
_CFDoExceptionOperation + 528
3 com.apple.AppKit 0x00007fff81f75e26 _NSAppKitLock + 81
4 com.apple.AppKit 0x00007fff81f80f8f -[NSView nextKeyView] + 56
5 com.apple.AppKit 0x00007fff81f81018 -[NSView
_primitiveSetNextKeyView:] + 72
6 com.apple.AppKit 0x00007fff820732b1 -[NSView
_recursiveSetDefaultKeyViewLoop] + 242
7 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
8 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
9 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
10 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
11 com.apple.AppKit 0x00007fff82072fc3 -[NSView
_setDefaultKeyViewLoop] + 279
12 com.apple.AppKit 0x00007fff82072e70 -[NSWindow
recalculateKeyViewLoop] + 36
13 com.apple.AppKit 0x00007fff821dd149
-[NSSavePanel(NSSavePanelRuntime) _loadPreviousModeAndLayout] + 39
14 com.apple.AppKit 0x00007fff821dcf9e
-[NSSavePanel(NSSavePanelRuntime) runModalForDirectory:file:types:] +
71
15 com.NZBVortex.NZBVortex 0x000000010000b7ee
-[MainWindowViewController openNZBFileButtonClick:] + 62
16 com.apple.AppKit 0x00007fff821c96bf
-[NSToolbarButton sendAction:to:] + 77
17 com.apple.AppKit 0x00007fff821c8bb7
-[NSToolbarItemViewer mouseDown:] + 5362
18 com.apple.AppKit 0x00007fff82082783 -[NSWindow
sendEvent:] + 5068
19 com.apple.AppKit 0x00007fff8204fd46 -[NSApplication
sendEvent:] + 5089
20 com.apple.AppKit 0x00007fff81faa562 -[NSApplication run] + 497
21 com.apple.AppKit 0x00007fff81f772f0 NSApplicationMain + 373
22 com.NZBVortex.NZBVortex 0x0000000100012a69 main + 9
23 com.NZBVortex.NZBVortex 0x0000000100001a84 start + 52
Crash 2
Process: NZBVortex [43600]
Path: /Users/cero/Downloads/NZBVortex.app/Contents/MacOS/NZBVortex
Identifier: com.NZBVortex.NZBVortex
Version: 0.5.5 (0.5.5)
Code Type: X86-64 (Native)
Parent Process: launchd [97]
Interval Since Last Report: 727 sec
Crashes Since Last Report: 1
Per-App Interval Since Last Report: 616 sec
Per-App Crashes Since Last Report: 1
Date/Time: 2010-03-23 23:11:20.000 +0100
OS Version: Mac OS X 10.5.8 (9L31a)
Report Version: 6
Anonymous UUID: 98AB0386-590B-4E0D-B7AC-3F7AA4E7238E
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Crashed Thread: 0
Application Specific Information:
objc[43600]: alt handlers in objc runtime are buggy!
Thread 0 Crashed:
0 libobjc.A.dylib 0x00007fff82baef6e _objc_fatal + 238
1 libobjc.A.dylib 0x00007fff82bb2ea4
objc_addExceptionHandler + 302
2 com.apple.CoreFoundation 0x00007fff842b1090
_CFDoExceptionOperation + 528
3 com.apple.AppKit 0x00007fff81f75e26 _NSAppKitLock + 81
4 com.apple.AppKit 0x00007fff81f80f8f -[NSView nextKeyView] + 56
5 com.apple.AppKit 0x00007fff81f81018 -[NSView
_primitiveSetNextKeyView:] + 72
6 com.apple.AppKit 0x00007fff820732b1 -[NSView
_recursiveSetDefaultKeyViewLoop] + 242
7 com.apple.AppKit 0x00007fff82156700 -[NSTabView
_recursiveSetDefaultKeyViewLoop] + 119
8 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
9 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
10 com.apple.AppKit 0x00007fff82072fc3 -[NSView
_setDefaultKeyViewLoop] + 279
11 com.apple.AppKit 0x00007fff82072e70 -[NSWindow
recalculateKeyViewLoop] + 36
12 com.NZBVortex.NZBVortex 0x000000010000b527
-[MainWindowViewController showView:sender:] + 1639
13 com.NZBVortex.NZBVortex 0x000000010000ae6b
-[MainWindowViewController
preferencesSaveAlertDidEnd:returnCode:contextInfo:] + 91
14 com.apple.AppKit 0x00007fff82224291 -[NSAlert
didEndAlert:returnCode:contextInfo:] + 107
15 com.apple.AppKit 0x00007fff82224197 -[NSAlert
buttonPressed:] + 279
16 com.apple.AppKit 0x00007fff82085d46 -[NSApplication
sendAction:to:from:] + 97
17 com.apple.AppKit 0x00007fff82085c7f -[NSControl
sendAction:to:] + 97
18 com.apple.AppKit 0x00007fff820851b0 -[NSCell
trackMouse:inRect:ofView:untilMouseUp:] + 1841
19 com.apple.AppKit 0x00007fff820849d6 -[NSButtonCell
trackMouse:inRect:ofView:untilMouseUp:] + 611
20 com.apple.AppKit 0x00007fff8208422f -[NSControl
mouseDown:] + 735
21 com.apple.AppKit 0x00007fff82082783 -[NSWindow
sendEvent:] + 5068
22 com.apple.AppKit 0x00007fff8204fd46 -[NSApplication
sendEvent:] + 5089
23 com.apple.AppKit 0x00007fff81faa562 -[NSApplication run] + 497
24 com.apple.AppKit 0x00007fff81f772f0 NSApplicationMain + 373
25 com.NZBVortex.NZBVortex 0x0000000100012a69 main + 9
26 com.NZBVortex.NZBVortex 0x0000000100001a84 start + 52
Crash 3
Process: NZBVortex [43520]
Path: /Users/cero/Downloads/NZBVortex.app/Contents/MacOS/NZBVortex
Identifier: com.NZBVortex.NZBVortex
Version: 0.5.5 (0.5.5)
Code Type: X86-64 (Native)
Parent Process: launchd [97]
Interval Since Last Report: 23487 sec
Crashes Since Last Report: 2
Per-App Interval Since Last Report: 2025 sec
Per-App Crashes Since Last Report: 1
Date/Time: 2010-03-23 22:59:05.484 +0100
OS Version: Mac OS X 10.5.8 (9L31a)
Report Version: 6
Anonymous UUID: 98AB0386-590B-4E0D-B7AC-3F7AA4E7238E
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Crashed Thread: 0
Application Specific Information:
objc[43520]: alt handlers in objc runtime are buggy!
Thread 0 Crashed:
0 libobjc.A.dylib 0x00007fff82baef6e _objc_fatal + 238
1 libobjc.A.dylib 0x00007fff82bb2ea4
objc_addExceptionHandler + 302
2 com.apple.CoreFoundation 0x00007fff842b1090
_CFDoExceptionOperation + 528
3 com.apple.AppKit 0x00007fff81f75e26 _NSAppKitLock + 81
4 com.apple.AppKit 0x00007fff81f80f8f -[NSView nextKeyView] + 56
5 com.apple.AppKit 0x00007fff81f81018 -[NSView
_primitiveSetNextKeyView:] + 72
6 com.apple.AppKit 0x00007fff820732b1 -[NSView
_recursiveSetDefaultKeyViewLoop] + 242
7 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
8 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
9 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
10 com.apple.AppKit 0x00007fff82073300 -[NSView
_recursiveSetDefaultKeyViewLoop] + 321
11 com.apple.AppKit 0x00007fff82072fc3 -[NSView
_setDefaultKeyViewLoop] + 279
12 com.apple.AppKit 0x00007fff82072e70 -[NSWindow
recalculateKeyViewLoop] + 36
13 com.apple.AppKit 0x00007fff821dd149
-[NSSavePanel(NSSavePanelRuntime) _loadPreviousModeAndLayout] + 39
14 com.apple.AppKit 0x00007fff821dcf9e
-[NSSavePanel(NSSavePanelRuntime) runModalForDirectory:file:types:] +
71
15 com.NZBVortex.NZBVortex 0x000000010000b7ee
-[MainWindowViewController openNZBFileButtonClick:] + 62
16 com.apple.AppKit 0x00007fff821c96bf
-[NSToolbarButton sendAction:to:] + 77
17 com.apple.AppKit 0x00007fff821c8bb7
-[NSToolbarItemViewer mouseDown:] + 5362
18 com.apple.AppKit 0x00007fff82082783 -[NSWindow
sendEvent:] + 5068
19 com.apple.AppKit 0x00007fff8204fd46 -[NSApplication
sendEvent:] + 5089
20 com.apple.AppKit 0x00007fff81faa562 -[NSApplication run] + 497
21 com.apple.AppKit 0x00007fff81f772f0 NSApplicationMain + 373
22 com.NZBVortex.NZBVortex 0x0000000100012a69 main + 9
23 com.NZBVortex.NZBVortex 0x0000000100001a84 start + 52
I am answering my own question, but the credits should go to diciu and tedge. If they create an answer here I will move over the check to their account.
The solution was running the app in 32bit mode; more info: http://lists.apple.com/archives/objc-language/2008/Sep/msg00111.html
It looks like you have an error in openNZBFileButtonClick:
; or possibly you have set Release when closed on a window that shouldn't have it.
A crash bug in AppKit vis-a-vis window handling seems fairly unlikely.
精彩评论