View Full Version : How do I enable the "Enable Guard Malloc" option?

Spanky Deluxe
Jul 9, 2007, 11:06 AM

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 Deluxe
Jul 9, 2007, 11:43 AM
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. :)

Sep 19, 2011, 08:47 AM
Just curious

Sep 19, 2011, 12:32 PM
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.