How do I enable the "Enable Guard Malloc" option?

Discussion in 'Mac Programming' started by Spanky Deluxe, Jul 9, 2007.

  1. macrumors demi-god

    Spanky Deluxe

    Joined:
    Mar 17, 2005
    Location:
    London, UK
    #1
    Hi!

    I've got some code that was written by someone else for Linux. I need to expand on the code a bit as part of a project, however, I can't get the damned original code to work! I can get the code to compile without any problems now that I've got fink handling fftw etc, however, my problem arises in that when I run, I get a "has exited due to signal 11 (SIGSEGV)" error.
    After a bit of googling, I've worked out that this is a memory access error and that the way to track it down would be to click the "Enable Guard Malloc" menu item. That item's greyed out for me though.
    My code is all in straight old C if that matters. I haven't been able to find any reason why that option would be greyed out!

    Spanky
     
  2. thread starter macrumors demi-god

    Spanky Deluxe

    Joined:
    Mar 17, 2005
    Location:
    London, UK
    #2
    Never mind, I worked it out. You can't enable or disable it while a debug window is running I think. I restarted Xcode, opened the code afresh and it let me choose it. :)
     
  3. macrumors member

    Joined:
    Mar 22, 2011
  4. macrumors regular

    Joined:
    Mar 5, 2006
    #4
    In Xcode 4 you enable Guard Malloc from the scheme editor. Choose Edit Scheme from the Scheme menu in the project window toolbar. Select the Run step on the left side of the scheme editor. Click the Diagnostics button in the scheme editor. Select the Enable Guard Malloc checkbox.

    In Xcode 3 choose Run > Enable Guard Malloc to enable Guard Malloc.
     

Share This Page