0

I built the app with Standard Architectures (64-bit Intel) (x86_64), SDK: Latest OSX (OSX 10.9) and deployment target: 10.8 using Xcode 5.1.1.

Upon Opening NSSavePanel, once the user clicks a folder, the app crashes. Below are the code snippets and the crash log. This issue does not happen in my development macbook (OS: 10.9.5). It just happens in the client's macbook (OS: 10.8.2). I can't run Xcode in my client's macbook by the way.

-(IBAction)onSaveScriptFileAs:(id)sender
{
    NSSavePanel *theSavePanel = [NSSavePanel savePanel];
    [theSavePanel setTitle:@"Save Test Script As"];
    [theSavePanel setAllowedFileTypes:[NSArray arrayWithObject:@"ts"]];

    if (tempScriptFileName != nil) {
        [theSavePanel setNameFieldStringValue:tempScriptFileName];
    }

    if ([theSavePanel runModal] == NSFileHandlingPanelOKButton)
    {
        [self saveScriptFile:[[theSavePanel URL] path]];
        [self setTempScriptFileName:nil];
    }
}

Crash Log:

Process:         MyAppName [5480]
Path:            /Volumes/VOLUME/*/MyAppName5.18.85b.app/Contents/MacOS/MyAppName
Identifier:      com.MyAppName
Version:         5.18.85b (5.18.85b) 
Code Type:       X86-64 (Native)
Parent Process:  launchd [202]
User ID:         502

Date/Time:       2014-09-15 09:28:58.781 -0700
OS Version:      Mac OS X 10.8.2 (12C3104)
Report Version:  10

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

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008

VM Regions Near 0x8:
--> 
__TEXT                 00000001085db000-000000010866a000 [  572K] r-x/rwx SM=COW      /Volumes/VOLUME/*/MyAppName5.18.85b.app/Contents/MacOS/MyAppName

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   ???                             0x0000000000000008 0 + 8
1   com.apple.FinderKit             0x00007fff8aea97ee ApplicationURL(TString const&) + 77
2   com.apple.FinderKit             0x00007fff8aea9a27 AppBundleIDCanOpenExtension(TString  const&, TString const&) + 392
3   com.apple.FinderKit             0x00007fff8aeaa245 PreviewCanOpenExtension(TString const&) + 177
4   com.apple.FinderKit             0x00007fff8aeaa55e -[FIFinderViewGutsController finderLocationPopUpWillDisplay:] + 198
5   com.apple.FinderKit             0x00007fff8aed47ff -[FILocationPopUp menuNeedsUpdate:] + 46
6   com.apple.AppKit                0x00007fff89c486a8 -[NSMenu _populateFromDelegateWithEventRef:] + 674
7   com.apple.AppKit                0x00007fff89bece64 -[NSMenu _populateWithEventRef:] + 83
8   com.apple.AppKit                0x00007fff89c476ac -[NSCarbonMenuImpl _carbonPopulateEvent:handlerCallRef:] + 427
9   com.apple.AppKit                0x00007fff89c47245 NSSLMMenuEventHandler + 342
10  com.apple.HIToolbox             0x00007fff8769ff0a DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1206
11  com.apple.HIToolbox             0x00007fff8769f3d9 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 410
12  com.apple.HIToolbox             0x00007fff8769f236 SendEventToEventTargetWithOptions + 43
13  com.apple.HIToolbox             0x00007fff876e8d58 SendMenuPopulate(MenuData*, OpaqueEventTargetRef*, unsigned int, double, unsigned int, OpaqueEventRef*, unsigned char*) + 279
14  com.apple.HIToolbox             0x00007fff87671d5a SendMenuOpening(MenuSelectData*, MenuData*, double, unsigned int, unsigned int, __CFDictionary*, unsigned char, unsigned char*) + 286
15  com.apple.HIToolbox             0x00007fff87806cff PopUpMenuSelectCore(MenuData*, Point, double, Point, unsigned short, unsigned int, Rect const*, unsigned short, unsigned int, Rect const*, Rect const*, __CFString const*, OpaqueMenuRef**, unsigned short*) + 895
16  com.apple.HIToolbox             0x00007fff87806924 _HandlePopUpMenuSelection7 + 629
17  com.apple.AppKit                0x00007fff89cca61b _NSSLMPopUpCarbonMenu3 + 3916
18  com.apple.AppKit                0x00007fff8a02bd2a _NSPopUpCarbonMenu3 + 39
19  com.apple.AppKit                0x00007fff89cc95dc -[NSCarbonMenuImpl popUpMenu:atLocation:width:forView:withSelectedItem:withFont:withFlags:withOptions:] + 346
20  com.apple.AppKit                0x00007fff89e8d315 -[NSPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 540
21  com.apple.AppKit                0x00007fff89b15c9c -[NSControl mouseDown:] + 820
22  com.apple.AppKit                0x00007fff89b0d60e -[NSWindow sendEvent:] + 6853
23  com.apple.AppKit                0x00007fff89b09744 -[NSApplication sendEvent:] + 5761
24  com.apple.AppKit                0x00007fff89c7276a -[NSApplication _realDoModalLoop:peek:] + 582
25  com.apple.AppKit                0x00007fff89c729ce -[NSApplication runModalForWindow:] + 120
26  com.apple.AppKit                0x00007fff89ebddb6 -[NSSavePanel runModal] + 302
27  com.TopTestDFU                  0x00000001085f22fe -[AppController onSaveScriptFileAs:] + 148
28  com.apple.AppKit                0x00007fff89b18a59 -[NSApplication sendAction:to:from:] + 342
29  com.apple.AppKit                0x00007fff89c4e44c -[NSMenuItem _corePerformAction] + 406
30  com.apple.AppKit                0x00007fff89c4e13a -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 133
31  com.apple.AppKit                0x00007fff8993b46f -[NSMenu _internalPerformActionForItemAtIndex:] + 36
32  com.apple.AppKit                0x00007fff8993b2f7 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 135
33  com.apple.AppKit                0x00007fff89c47245 NSSLMMenuEventHandler + 342
34  com.apple.HIToolbox             0x00007fff8769ff0a DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1206
35  com.apple.HIToolbox             0x00007fff8769f3d9 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 410
36  com.apple.HIToolbox             0x00007fff876b51bd SendEventToEventTarget + 40
37  com.apple.HIToolbox             0x00007fff876ebe89 SendHICommandEvent(unsigned int, HICommand const*, unsigned int, unsigned int, unsigned char, void const*, OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) + 443
38  com.apple.HIToolbox             0x00007fff87690c11 SendMenuCommandWithContextAndModifiers + 59
39  com.apple.HIToolbox             0x00007fff87690bc3 SendMenuItemSelectedEvent + 254
40  com.apple.HIToolbox             0x00007fff87690a4f FinishMenuSelection(SelectionData*, MenuResult*, MenuResult*) + 94
41  com.apple.HIToolbox             0x00007fff8766caab MenuSelectCore(MenuData*, Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) + 605
42  com.apple.HIToolbox             0x00007fff8766c0b8 _HandleMenuSelection2 + 565
43  com.apple.AppKit                0x00007fff89b069c6 _NSHandleCarbonMenuEvent + 245
44  com.apple.AppKit                0x00007fff89a28b7f _DPSNextEvent + 2073
45  com.apple.AppKit                0x00007fff89a27ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
46  com.apple.AppKit                0x00007fff89a1f283 -[NSApplication run] + 517
47  com.apple.AppKit                0x00007fff899c3cb6 NSApplicationMain + 869
48  com.TopTestDFU                  0x00000001085dc3d4 start + 52

Thank you!

albertleng
  • 61
  • 7

1 Answers1

0

My only guess is that your using Latest SDK 10.9, and client is running on 10.8. Try linking with 10.8 SDK and giving that to client.

By the way, I use Xcode 6, but I'm still linking to 10.6 SDK using some trickery. Must support older clients.

Keith Knauber
  • 752
  • 6
  • 13
  • The issue is not solved although I used SDK 10.8. The crash log: Process: MyApp [704] Path: /Volumes/VOLUME/*/MyApp5.18.84e_1.app/Contents/MacOS/MyApp Identifier: com.MyApp Version: 5.18.85e (5.18.85e) Code Type: X86-64 (Native) Parent Process: launchd [199] User ID: 502 Date/Time: 2014-09-22 11:09:07.665 -0700 OS Version: Mac OS X 10.8.2 (12C3104) Report Version: 10 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008 – albertleng Sep 23 '14 at 03:28
  • The issue still persists. the program crashes when executing if ([theSavePanel runModal] == NSFileHandlingPanelOKButton) – albertleng Sep 26 '14 at 03:31
  • Still, the issue is happening on XCode 14. The same is not happening when we run the command line app, but not in normal mac os applications...Any idea? – AmbiBala Feb 17 '23 at 07:50