AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only

MALLOCDEBUG Tool For Thread-Safe Application in AIX 6.1

  • 1.  MALLOCDEBUG Tool For Thread-Safe Application in AIX 6.1

    Posted Thu July 24, 2014 07:29 PM

    Originally posted by: zlippard


    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 this article 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.  

    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?


    #AIX-Forum