C Valgrind

Hello,
I'm running FreeBSD 12 and it appears that valgrind does not track malloc/free at all. I tried compiling under clang and gcc with no luck. Just to see if it was something in my code I installed a copy of Linux and valgrind found the leaks. Am I doing something wrong or is there another tool out there that will tell me if I forgot to free something? Thanks

Forgot to mention running on amd64 cpu.
 
Valgrind used to work very well to track errors with malloc and free, but it has had lots of problems on FreeBSD recently, lots of bugs are not being fixed. Here is another thread from a while ago.

 
Possibly devel/ElectricFence could be useful for heap allocation debugging?

I used to use that (before I had time to write a lot of my own debugging infrastructure) and it does pretty well. It also tracks some use after free errors too by locking memory.
 
Back
Top