Take the 2-minute tour ×

I'm trying to figure out what's corrupting my heap; I'm sure you envy me and my predicament.

SO tells me that I can turn on "Scribble" to write 0xAA into allocs and 0x55 into deallocs, to help me figure out where things are going wrong.

Only thing is, I've got no clue where/how to make good use of this. What do I use this for?

(Bonus: I'm curious about why those values, specifically, are used...)

I'm coding C/C++ in Xcode using openFrameworks and the Vamp psychoacoustic-labeling library, for what it's worth, but I think my question is more general than that.

share|improve this question
Some objection to the macosx native malloc debugger or valgrind (if it's currently operational there)? –  bmargulies May 30 '11 at 21:37
Huh? Sorry, I don't think I'm up to the level where I can parse that. Could you spell it out a little more loudly and clearly? –  buildsucceeded May 30 '11 at 21:49
I've set MallocGuardEdges and MallocCheckHeapStart/Each but don't see any changes in behavior. I assume I'm then supposed to do something in gdb to make use of these changes in malloc? –  buildsucceeded May 31 '11 at 12:28
add comment

1 Answer

  1. run 'man Guard_Malloc' or 'man libgmalloc' and read about the debugging options.

  2. see valgrind, perhaps starting from http://valgrind.org/downloads/current.html

share|improve this answer
Valgrind looks very powerful; right now it's giving me tons of errors from library code. I'll try to sort it out though. –  buildsucceeded May 31 '11 at 12:25
@icky I left off the letter 'g' by mistake. see edit. –  bmargulies May 31 '11 at 12:39
got "No manual entry for gmalloc" on my machine, nothing from Google either... help? –  buildsucceeded May 31 '11 at 13:48
@icky oops, once more with feeling. –  bmargulies May 31 '11 at 13:52
add comment

Your Answer


