Live data from Hacker News

Twenty years of Valgrind

nnethercote.github.io

31–40 of 118 posts

Re: Twenty years of Valgrind

#31
Happy birthday Valgrind. Next year you'll be able to drink in the US!

Being a UK PhD holder, a sentence stood out out to me was a commentary/comparison between UK and US PhDs: "This was a three year UK PhD, rather than a brutal six-or-more year US PhD."

My cousin has a US PhD and judging from what he tells me. It is a lot more rigorous than UK PhDs.

Re: Twenty years of Valgrind

#32

What other great tools are there in the vein of valgrind and AFL?

In my obviously biased opinion, very specialised, but sometimes exactly what you needed (I have used this in anger maybe 2-3 times in my career since then, which is why I wrote the C version):

https://github.com/tialaramex/leakdice (or https://github.com/tialaramex/leakdice-rust)

Leakdice implements some of Raymond Chen's "The poor man’s way of identifying memory leaks" for you. On Linux at least.

https://bytepointer.com/resources/old_new_thing/20050815_224...

All leakdice does is: You pick a running process which you own, leakdice picks a random heap page belonging to that process and shows you that page as hex + ASCII.

The Raymond Chen article explains why you might ever want to do this.

Re: Twenty years of Valgrind

#33
post #2

I wish I hadn't read this article because now I know that I've been mispronouncing Valgrind for nearly 20 years but I'm not going to stop. (Kidding. Thanks for Valgrind! I still use it for assessing memory corruption vulnerabilities along with ASan.)

Our pipelines have asan ( and cpp check clang tidy coverity and coverage stuff) but no valgrind, is there something it is good at that we are missing?

The main reason for Valgrind would be if you're working with a binary that you can't recompile to add the ASAN instrumentation.

Re: Twenty years of Valgrind

#35

Earlier quoted context omitted.

I am not familiar with electric fence but I remember from my experience that there are definitely important things that I got from `perf` and `valgrind` that the alternative sanitizers did not provide. Can't recall what now of course.

asan/ubsan do not detect uninitialized memory reads (though ubsan can detect when bools take on invalid bit patterns from uninitialized memory), and msan requires rebuilding the standard library or something, so I've never used msan. Valgrind is slow, but detects uninitialized memory reads properly, and doesn't require rebuilding the app (which is useful when running a complex or prebuilt app for short periods of tim…

>msan requires rebuilding the standard library or something

Yes, which is a PITA. But even then, macOS is not supported anyway:

https://clang.llvm.org/docs/MemorySanitizer.html#supported-p...

Re: Twenty years of Valgrind

#37
post #2

I wish I hadn't read this article because now I know that I've been mispronouncing Valgrind for nearly 20 years but I'm not going to stop. (Kidding. Thanks for Valgrind! I still use it for assessing memory corruption vulnerabilities along with ASan.)

Fwiw I've literally worked with Nicholas (but not on valgrind) and I only learned this today somehow.

Re: Twenty years of Valgrind

#38
post #28
post #2

I wish I hadn't read this article because now I know that I've been mispronouncing Valgrind for nearly 20 years but I'm not going to stop. (Kidding. Thanks for Valgrind! I still use it for assessing memory corruption vulnerabilities along with ASan.)

What other ways are there to (mis)pronounce it?

Pronouncing the "-grind" like the word "grind". I think that's probably how most English-speakers first assume it's pronounced.

Re: Twenty years of Valgrind

#39
Valgrind's maintainers are super pleasant and have been quite helpful in a number of cases I've personally had to reach out to them.

Lovely piece of software toward which I owe a lot of gratitude.

Re: Twenty years of Valgrind

#40
post #2

I wish I hadn't read this article because now I know that I've been mispronouncing Valgrind for nearly 20 years but I'm not going to stop. (Kidding. Thanks for Valgrind! I still use it for assessing memory corruption vulnerabilities along with ASan.)

Our pipelines have asan ( and cpp check clang tidy coverity and coverage stuff) but no valgrind, is there something it is good at that we are missing?

If your tests can take the performance hit, Valgrind would tell you about uninitialized memory reads, which isn't covered by those tools you mentioned. If however, you are able to add MSAN (i.e. able to rebuild the entire product, including dependencies, with -fsanitize=memory) to the pipeline, then you would have the same coverage as Valgrind.
Post reply on HN