• 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 memory corruption? (C++)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging memory corruption? (C++)


  • Subject: Re: Debugging memory corruption? (C++)
  • From: "Sean McBride" <email@hidden>
  • Date: Fri, 30 Oct 2009 12:19:44 -0400
  • Organization: Rogue Research Inc.

On 10/30/09 4:24 PM, Jean-Denis Muys said:

>My code is corrupting memory and I have a hard time finding the bug.
>Perhaps somebody can point me to some tool or idea that has escaped me
so far.

If your app can 1) run on 10.5  2) can run as 32 bit  3) does not use
Obj-C garbage collection, then try valgrind:
<http://valgrind.org/>

It's awesome.

>One question comes to mind right away: is there a way to call the malloc
>heap-checking routines from my program? I could then sprinkle my code
>where it makes sense with heap checks.
>
>Somewhat related is that I have set MallocCheckHeapEach to 100. This
>already slows the app down quite a bit. I can probably set to an even
>smaller value, but I don't think I can set it to 1.
>
>Or if I change it to 1 *at run time* how can I inform malloc that I want
>the frequency to change? AFAICS, it only reads those environment
>variables at launch time.

I remember wanting exactly that.  I don't think you can.  The best you
can do is set Each to 1, and Start to some higher value.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Debugging memory corruption? (C++)
      • From: Jean-Denis Muys <email@hidden>
References: 
 >Debugging memory corruption? (C++) (From: Jean-Denis Muys <email@hidden>)

  • Prev by Date: Re: Debugging memory corruption? (C++)
  • Next by Date: Re: LLVM 2.6 Released / Can it be used with Xcode?
  • Previous by thread: Re: Debugging memory corruption? (C++)
  • Next by thread: Re: Debugging memory corruption? (C++)
  • Index(es):
    • Date
    • Thread