• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Debugging strange memory ( ? ) problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging strange memory ( ? ) problem


  • Subject: Re: Debugging strange memory ( ? ) problem
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 30 Apr 2017 17:38:10 -0500

On Apr 30, 2017, at 4:02 PM, Peter Hudson <email@hidden> wrote:
>
> Thanks Ken.
>
> I'll give zombies a go.
> What's baffling is that the pointer has remained the same - in terms of address - but the type of underlying object appears to be different.
> Not sure how that could happen.

There's a memory management bug somewhere.  The object has been under-retained or over-released.  As a result, it has been deallocated.  Any pointer to it is now a "dangling" pointer.  The pointer variable still contains the same address, but that address is no longer valid.  Later, some other object may be allocated and given the address of the old object.  The dangling pointers now, by coincidence, point to this new object.  Disaster ensues.

This is exactly the scenario that the Zombies instrument detects.  The original object is never actually deallocated.  It's just transformed into a landmine that deliberately blows up your program when it's accessed.  Since it was never deallocated, no other object can be allocated in its place.  The fact that the zombie object is a landmine may sound bad, but it's actually much better then the semi-random things that can happen otherwise.  Finding problems early and definitively is good.  Finally, Instruments is able to give you the information necessary to figure out how the object was under-retained or over-released.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Debugging strange memory ( ? ) problem (From: Peter Hudson <email@hidden>)
 >Re: Debugging strange memory ( ? ) problem (From: Ken Thomases <email@hidden>)
 >Re: Debugging strange memory ( ? ) problem (From: Peter Hudson <email@hidden>)

  • Prev by Date: Re: Debugging strange memory ( ? ) problem
  • Previous by thread: Re: Debugging strange memory ( ? ) problem
  • Index(es):
    • Date
    • Thread