Skip to content

Comment on Valgrind is much more than a leak checking toolparent

Comments

People say that and it's not true. Any bug that can be caught by a change in the language can also be caught by valgrind.

And if you are still worried about bugs, you can use -fsanitize=....

Valgrind can only catch bugs that are exposed while the program is running under it. In most cases (when you have a good testsuite), this is sufficient. However, especially in the case of security vulnerabilities, you might have a bug that is only exposed on specific or malformed input that non of your testsuites check for. For example, if you are parsing input from an untrusted source, and that input has a length prefixed field. Unless your testsuite includes a message whose length prefix is longer than the actual length, Valgrind will not tell you that you will potentially overflow, because you do not do so in any of your tests.

I understood all that, that's why I mentioned -fsanitize

Which only works in two C compilers that aren't available in all OS out there.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.