Question

I have a program which does 5 mallocs and 3 frees. I call mtrace() at the start and muntrace() at the end. mtrace will report the missing frees if I run the program normally. If I do:

valgrind -v --log-file=val.log --leak-check=full --show-reachable=yes my_program

valgrind will report the missing frees but mtrace will not.

So I guess you can't use them both together - valgrind will override mtrace?

Was it helpful?

Solution

So I guess you can't use them both together

Correct.

valgrind will override mtrace?

I don't believe Valgrind overrides mtrace, but it does override malloc and free, so mtrace simply never sees either malloc of free.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top