I debugged the shameful error EXC_BAD_ACCESS for several days. NSZombieEnabled = YES did not offer anything. The call stack was different every time I received an error that was every 5 or 6 starts.
I saw a hint to enable malloc protection (which is now in the schematic editor for Xcode 4) on the Lou Franco website: Understanding EXC_BAD_ACCESS . As soon as I did this, my program settled on the exact line that caused this elusive error.
According to its description, guard malloc creates separate pages for each malloc and deletes the entire page when freeing memory, which leads to a program crash when accessing free memory. For general development, why don't I just keep the malloc guard all the time? It seems easy to catch certain types of memory errors. If I do not test memory management or performance specifically, is there a drawback to using it?
malloc iphone exc-bad-access guard
brodney
source share