1

My app crashes without any info, then i turn the zombie objects and malloc scribble on and try to catch the failure point. But it doesn't crashes anymore with zombie objects. When i turn off zombie objects and malloc scribble, the crash happens again. How can i catch the failure point? Any ideas?

bashrc
  • 4,725
  • 1
  • 22
  • 49
Kira
  • 243
  • 2
  • 9
  • 1
    I'm sure it would help to explain something about the crash -- is it repeatable, is it in response to user input, and so forth. – Noumenon May 18 '16 at 04:05
  • tip: i am testing what will happen when i pick up a phonecall in my app. – Kira May 18 '16 at 04:06
  • When you turn on zombies, the app crashes resulting from dangling pointers are replaced with a nice debugger messages showing use of dangling pointer. Are you saying that you're not getting any errors in the debug console telling you about accessing zombie objects? That somewhat undermines the presumption that the problem is from a dangling pointer, but rather it might possibly be something else. So, (a) please confirm that you're really not seeing any messages re zombies; and (b) tell us why you think you have dangling pointer. A stack trace and more tech info on crash would be helpful. – Rob May 18 '16 at 05:04

1 Answers1

3

The crash is caused by a "dangling pointer" — an object that you send a message to after it has been released.

But with zombies turned on, no objects are ever released. That is why they are called zombies! So there are no dangling pointers; instead, all the objects leak. Leaking doesn't cause a crash, and there are no dangling pointers so the crash goes away.

The point is to give you a chance to understand what object you are sending a message to when the object would have been released if you were not using zombies.

matt
  • 515,959
  • 87
  • 875
  • 1,141