title: ios Zombie detection
body: <p>I'm having (in my opinion) a very difficult problem in my code. It crashes randomly at different places in the code. The project is a ARC project. </p>
  
  <p>So my program crashes occaisonally with this messages:</p>
  
  <pre><code>malloc: *** error for object 0xd2dd8b0: incorrect checksum for freed object - object was probably modified after being freed.
  *** set a breakpoint in malloc_error_break to debug
  </code></pre>
  
  <p>I already set a breakpoint for <code>malloc_error_break</code> but I don't get any information out of it. When the code crashes ,XCode shows me the place in the code where it happens. But as I already said the crashes are randomly and do not occur always. But it seems as if the crashes are concentrated at on particular line in the code. </p>
  
  <p>Now, I wanted to debug it using the instruments that come with xcode. After a bit of googling i found the following stuff on stackoverflow: <a href="https://stackoverflow.com/questions/2190227/how-do-i-setup-nszombieenabled-in-xcode-4/8863063#8863063">How do I set up NSZombieEnabled in Xcode 4?</a> and <a href="https://stackoverflow.com/questions/7214175/xcode-malloc-error">Xcode malloc error</a>.</p>
  
  <p>So the first link describes how to start zombie detection out of xcode itself by clicking the run button in xcode and choose "Profile". The problem I have is, that I cannot find "Zombies"  when choosing the template for the trace document in my version of xcode (4.2). But if I start Instruments outside xcode (e.g. from finder) I can choose zombies. </p>
  
  <p>Okay, here is what I did:</p>
  
  <p>1) Start Instruments from finder and choose Profile "Zombies".</p>
  
  <p>2) Start iphone app from xcode in the iphone simulator (normal run (not profile or debug)).</p>
  
  <p>3) In Instruments "Choose Target"->"Attach to process"->"iPhone Simulator (57529)".</p>
  
  <p>4) Instruments begins to recod something (I cannot figure out what it does).</p>
  
  <p>5) Start playing around with the app until it crashes.</p>
  
  <p>Eventually the app crashes and here is a screenshot of instruments after crashing the app:
  <img src="https://i.stack.imgur.com/Kd8MS.png" alt="enter image description here"></p>
  
  <p>My questions:</p>
  
  <p>1) Is Zombies adequate for my problem or should I use another analyizes tool?</p>
  
  <p>2) What tells me instruments in it's output after crashing?</p>