Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> also verifying with Valgrind every step of the way

This is...both extremely obvious, and also not something that I've ever done before, thought of doing, or seen anyone else do.

Every single instance of Valgrind usage I've encountered or initiated has been triggered by a specific bug or performance regression.

Proactive use of the Valgrind suite (Memcheck and Helgrind at least) as part of the development process would probably result in massively better stability of most tools - and would also make it far easier to find bugs (as you could find them when they were introduced rather than hundreds of commits later).





I've used valgrind proactively as long as I've been programming in C and C++.

The errors that are caught by valgrind (and asan) will very often not cause immediate crashes or any kind of obvious bugs. Instead, they cause intermittent bugs that are very hard to catch otherwise. They may even be security vulnerabilities.

Another good reason for using it proactively is that small memory leaks tend to sneak in over time. They might not cause any issues and most of them aren't accumulative. However, having all those leaks in there makes it much more difficult to find big leaks when they happen because you have to sift through all the insignificant ones before you can fix the one that's causing problems.


I've used Valgrind (mainly memcheck) as a proactive tool or at least as a tool to fish for easy to fix issues before spending too much time debugging specific reports. Main issue is the huge performance overhead that make interactive use under it less than fun - but IMO running your testsuite under it from time to time at least is a no brainer.

> Proactive use of the Valgrind suite (Memcheck and Helgrind at least) as part of the development process

Yeah, except that it's: slow and expensive and therefore can't be a part of the "short cycle" (edit code, compile, test, iterate) only the "long cycle" (nightly build, test suite). Also valgrind is not exactly designed to directly integrate in a test suite and that requires work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: