update OS 10.10 crashes program

Discussion in 'Mac Programming' started by larswik, Jun 7, 2015.

  1. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #1
    I updated to 10.10 and downloaded the latest Xcode. Today I tried to run a program I have been working on for the last year and it crashes before it even launches the app in Xcode? I set the breakpoint and it seems that the problem is in the NSApplicationMain. I have not seen an error like this and it is confusing. I did a web search but couldn't find any good answers I could follow. I took a screen shot.

    If anyone could take a look at it and point me in the right direction I would be thankful.
     

    Attached Files:

  2. Red Menace macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    What OS and Xcode versions did you update from? What kind of application/project is it?
     
  3. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #3
    I updated from 10.9 to 10.10.3 Xcode is 6.3.2. The application is simple and an aid to create a graphic. from selected images. It loads images and displays them in a scrollView. I pick for images and then fill in string data and press an NSButton to create context for the images and then it creates a .tif file.
     
  4. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #4
    Have you tried to move the breakpoint until you hit the crash? Also, the crash report may give you some clues.
     
  5. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #5
    I think the very first line break that I can set is in the AppDelegate.m. I set a breakpoint where I instantiated a sharedArray. The program crashes before it even hits this first line of code. I set up a custom breakpoint to stop where it throws an exception. I did a screen capture in my first post that shows where it stopped. If the breakpoint was something simple like an array out of bounds I could easily fix it.

    Code:
    #import "AppDelegate.h"
    
    @implementation AppDelegate
    @synthesize sharedArray;
    
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
    {
        // Insert code here to initialize your application
        sharedArray = [[NSMutableArray alloc] init]; // This is my first line of code that should be called.
        [self.window setOpaque:NO];
        NSColor *backgroundColor = [self.window backgroundColor];
        backgroundColor = [backgroundColor colorWithAlphaComponent:0.6];
      
        [self.window setBackgroundColor:backgroundColor];
        //[[self window] setAlphaValue:0.5];
    }
    
    @end
     
  6. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #6
    Yes, it stopped there since you set the breakpoint there. I was just asking if you tried to move the breakpoint to isolate the exact line. How about the crash report?
     
  7. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #7
    Thanks for the continuing help Subsonix, I set a breakpoint in main.m for the return line. I ran the program and it stopped at that breakpoint, I clicked on the continue program execution button and it worked just fine till the program fully launched? I can't explain it but it is working just fine now. I don't understand how it can fix itself?

    By the way I included an image that has the crash data in the display window below. I don;t know if there is a more detailed folder that contains other crash data files to review or if its the normal debug area that tells you why it crashed. In this case there was no data below as you can see from the image.

    Thanks again!
     

    Attached Files:

  8. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #8
    I don't know what is going on, but from the first post I was thinking of applicationDidFinishLaunching that you showed in the second post as a refinement over: "it seems that the problem is in the NSApplicationMain". Anyway, the crash report should be in ~/Library/Logs/DiagnosticReports/.
     
  9. briloronmacrumo macrumors 6502

    briloronmacrumo

    Joined:
    Jan 25, 2008
    Location:
    USA
    #9
    FWIW: Cleaning the build folder is sometimes helpful. Product menu==>Clean. Then hold down option key and select 'Clean Build Folder' on same Product menu.
     
  10. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #10
    Its odd. There is no crash report. Here is a screenshot I took of that folder, there is just a finder crash back in May. Strange???

    briloronmacrumo:Thanks for that info. I did try to clean it but I never tried to hold down the option key first.
     

    Attached Files:

  11. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #11
    Have you rebooted the computer since last crash? This folder is regularly cleaned on reboot, at least for reports that are not sent to Apple. I use a script that opens the latest report in a pager when using Terminal (almost always), although this may have changed in 10.10.

    The implication of your position is that the issue is in Apple runtime or frameworks, not your code, on the other hand, not all code crashes on startup in 10.10.
     
  12. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #12
    Yes, it's been rebooted. I have 2 hard drives, one with 10.7 which I use for my work editing videos and graphics. Since Apple wants everything to run on the latest OS or IOS and ties Xcode to that I installed a second drive that I use use for programing and only have xcode and photoshop installed on that, So I swap between the 2 depending on what I need to do.

    Thanks again for helping me work though it.
     

Share This Page