[cfe-dev] valgrind memcheck shows leaks in svn clang compile of simplest c++ program

Sebastian Redl sebastian.redl at getdesigned.at
Sun Dec 30 10:52:05 PST 2012


On 30.12.2012, at 14:33, Larry Evans wrote:

> Is using valgrind memcheck a good way to detect memory leaks in clang?

No. Look at this part of the command line:

>> ==5556== Command: /home/evansl/download/llvm/svn/top/out/debug/install/bin/clang -cc1 -disable-free

This option (passed by default from the driver to the main compiler) instructs Clang not to free any of the AST nodes it allocates, to save time on process shutdown. So obviously they all leak.

Sebastian



More information about the cfe-dev mailing list