title: MALLOCDEBUG showing random output when using xlc_r
body: <p>I have a program, compiled using xlc_r, that spawns off multiple threads and am trying to trace it to see if there's any memory leaks.  I've gone through <a href="http://www.ibm.com/developerworks/aix/library/au-mallocdebug.html" rel="nofollow">this article</a> detailing how I can use the MALLOCDEBUG feature that's built in to AIX, but after running format_mallocdebug_op.sh, it shows memory leaks all over the place for random pthread and file methods such as pthread_attri_init, _pth_init, fopen, fwrite, etc.<br>
  I then made a smaller test program that purposefully doesn't free a char * and compiled it with xlc_r and almost the exact same output appeared.  I then compiled the test program again but with xlc and it worked correctly, showing the one char * memory leak and that was it.  It seems that the MALLOCDEBUG feature doesn't work well with multi-threaded compiled applications.  Is there a setting to tell it to be aware of this?</p>