• 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: Moderated post on self going out of scope
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moderated post on self going out of scope


  • Subject: Re: Moderated post on self going out of scope
  • From: David Blanton <email@hidden>
  • Date: Mon, 18 Jan 2010 20:50:50 -0700

So I set stack-protector-all as "other C++ flags" and got _stack_chk_fail


So this means the C++ constructor is corupting the stack?

-db
On Jan 18, 2010, at 8:28 PM, Ken Thomases wrote:

On Jan 18, 2010, at 9:17 PM, David Blanton wrote:

In a view IBAction I instance a C++ class. As soon as the class is instanced, self in the variables window, goes to 0x0 !

Try logging the value of self, rather than relying on the debugger display. The debugger can sometimes be wrong.


Otherwise, make sure the constructor of your C++ class isn't trashing memory. Sounds like writing past the bounds of a stack variable.

If you're doing placement new, you might also be messing that up.

You could try compiling with -fstack-protector-all to try to detect stack smashers closer to where/when they happen.

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


  • Follow-Ups:
    • Re: Moderated post on self going out of scope
      • From: Ken Thomases <email@hidden>
References: 
 >Moderated post on self going out of scope (From: David Blanton <email@hidden>)
 >Re: Moderated post on self going out of scope (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Moderated post on self going out of scope
  • Next by Date: Re: Moderated post on self going out of scope
  • Previous by thread: Re: Moderated post on self going out of scope
  • Next by thread: Re: Moderated post on self going out of scope
  • Index(es):
    • Date
    • Thread