Cant migrate to ROOT6beta2 because of valgrind warnings

Hi,

I would like to migrate from v5-34-15 (compiled with g++) to v6 beta 2 (compiled with g++) but I can’t for the moment because of the enormous number of valgrind warnings related with llvm/clang/cling

//test.cc
#include "TFile.h"
int main(int argc,char *argv[]) {
    TFile file("test.root","UPDATE") ; 
    file.Write() ; 
    file.Close() ; 
    return 0 ; 
}

compiled with :

gcc -o test `root-config --cflags --libs` test.cc
valgrind test 2> valgrind.out.txt

I have put the complete valgrind.out.txt in attachment :

==7420== Memcheck, a memory error detector
==7420== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==7420== Using Valgrind-3.9.0.SVN and LibVEX; rerun with -h for copyright info
==7420== Command: ./test2
==7420== 
==7420== Conditional jump or move depends on uninitialised value(s)
==7420==    at 0x102953F0: clang::ASTDeclReader::VisitFriendDecl(clang::FriendDecl*) (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x1029EE64: clang::ASTDeclReader::Visit(clang::Decl*) (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x1029F211: clang::ASTReader::ReadDeclRecord(unsigned int) (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x10259C76: clang::ASTReader::GetDecl(unsigned int) (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x10259FD3: (anonymous namespace)::FindExternalLexicalDeclsVisitor::visit(clang::serialization::ModuleFile&, bool, void*) (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x10306CE3: clang::serialization::ModuleManager::visitDepthFirst(bool (*)(clang::serialization::ModuleFile&, bool, void*), void*) (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x10252052: clang::ASTReader::FindExternalLexicalDecls(clang::DeclContext const*, bool (*)(clang::Decl::Kind), llvm::SmallVectorImpl<clang::Decl*>&) (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x10908850: clang::DeclContext::LoadLexicalDeclsFromExternalStorage() const (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x1090894E: clang::DeclContext::decls_begin() const (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x108ECB8D: (anonymous namespace)::FinalOverriderCollector::Collect(clang::CXXRecordDecl const*, bool, clang::CXXRecordDecl const*, clang::CXXFinalOverriderMap&) (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x108F0AB1: clang::CXXRecordDecl::getFinalOverriders(clang::CXXFinalOverriderMap&) const (in /home/kulam/local/lib/root/libCling.so)
==7420==    by 0x109CFC52: (anonymous namespace)::FinalOverriders::FinalOverriders(clang::CXXRecordDecl const*, clang::CharUnits, clang::CXXRecordDecl const*) (in /home/kulam/local/lib/root/libCling.so)
==7420== 
==7420== 
==7420== HEAP SUMMARY:
==7420==     in use at exit: 35,531,154 bytes in 47,181 blocks
==7420==   total heap usage: 190,044 allocs, 142,863 frees, 170,545,124 bytes allocated
************************************
==7420== 
==7420== LEAK SUMMARY:
==7420==    definitely lost: 920 bytes in 1 blocks
==7420==    indirectly lost: 80 bytes in 3 blocks
==7420==      possibly lost: 233,889 bytes in 1,989 blocks
==7420==    still reachable: 35,291,325 bytes in 45,110 blocks
==7420==         suppressed: 4,940 bytes in 78 blocks
==7420== Reachable blocks (those to which a pointer was found) are not shown.
==7420== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==7420== 
==7420== For counts of detected and suppressed errors, rerun with: -v
==7420== Use --track-origins=yes to see where uninitialised values come from
==7420== ERROR SUMMARY: 472 errors from 449 contexts (suppressed: 25 from 19)

And of course, I do the same with v5-34-15, there is no problem :

==11167== Memcheck, a memory error detector
==11167== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==11167== Using Valgrind-3.9.0.SVN and LibVEX; rerun with -h for copyright info
==11167== Command: ./test2
==11167== 
==11167== 
==11167== HEAP SUMMARY:
==11167==     in use at exit: 2,734,372 bytes in 32,494 blocks
==11167==   total heap usage: 67,183 allocs, 34,689 frees, 5,037,685 bytes allocated
==11167== 
==11167== LEAK SUMMARY:
==11167==    definitely lost: 0 bytes in 0 blocks
==11167==    indirectly lost: 0 bytes in 0 blocks
==11167==      possibly lost: 0 bytes in 0 blocks
==11167==    still reachable: 2,111,959 bytes in 27,268 blocks
==11167==         suppressed: 622,413 bytes in 5,226 blocks
==11167== Reachable blocks (those to which a pointer was found) are not shown.
==11167== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==11167== 
==11167== For counts of detected and suppressed errors, rerun with: -v
==11167== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 7)

My valgrind suppression files are :
./etc/valgrind-root.supp
./etc/valgrind-root-python.supp
./interpreter/llvm/src/utils/valgrind/x86_64-pc-linux-gnu.supp
./interpreter/llvm/src/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp

My system is :
Linux 3.10.17 #1 SMP Sat Nov 2 11:20:07 EDT 2013 x86_64 GNU/Linux
x86_64 Debian Wheezy
gcc (Debian 4.7.2-5) 4.7.2

Thanks for your help…
valgrind.out.txt (890 KB)

Result is worse with ROOT6 beta2 build with llvm/clang (itself builded with the procedure here for cling root.cern.ch/drupal/content/clin … structions)

==31708== Memcheck, a memory error detector
==31708== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==31708== Using Valgrind-3.9.0.SVN and LibVEX; rerun with -h for copyright info
==31708== Command: ./test2
==31708== 
==31708== Conditional jump or move depends on uninitialised value(s)
==31708==    at 0x10433B60: clang::ASTDeclReader::VisitFriendDecl(clang::FriendDecl*) (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x1043D5D4: clang::ASTDeclReader::Visit(clang::Decl*) (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x1043D981: clang::ASTReader::ReadDeclRecord(unsigned int) (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x103F84B6: clang::ASTReader::GetDecl(unsigned int) (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x103F8813: (anonymous namespace)::FindExternalLexicalDeclsVisitor::visit(clang::serialization::ModuleFile&, bool, void*) (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x104A5503: clang::serialization::ModuleManager::visitDepthFirst(bool (*)(clang::serialization::ModuleFile&, bool, void*), void*) (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x103F0892: clang::ASTReader::FindExternalLexicalDecls(clang::DeclContext const*, bool (*)(clang::Decl::Kind), llvm::SmallVectorImpl<clang::Decl*>&) (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x10AA6CA0: clang::DeclContext::LoadLexicalDeclsFromExternalStorage() const (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x10AA6D9E: clang::DeclContext::decls_begin() const (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x10A8AFDD: (anonymous namespace)::FinalOverriderCollector::Collect(clang::CXXRecordDecl const*, bool, clang::CXXRecordDecl const*, clang::CXXFinalOverriderMap&) (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x10A8EF01: clang::CXXRecordDecl::getFinalOverriders(clang::CXXFinalOverriderMap&) const (in /home/kulam/local/lib/root/libCling.so)
==31708==    by 0x10B6DBA2: (anonymous namespace)::FinalOverriders::FinalOverriders(clang::CXXRecordDecl const*, clang::CharUnits, clang::CXXRecordDecl const*) (in /home/kulam/local/lib/root/libCling.so)
==31708== 
==31708== 
==31708== HEAP SUMMARY:
==31708==     in use at exit: 35,635,173 bytes in 47,109 blocks
==31708==   total heap usage: 189,611 allocs, 142,502 frees, 170,584,902 bytes allocated
****************************************************************************************************
==31708== LEAK SUMMARY:
==31708==    definitely lost: 1,952 bytes in 22 blocks
==31708==    indirectly lost: 182,360 bytes in 2,272 blocks
==31708==      possibly lost: 235,122 bytes in 2,005 blocks
==31708==    still reachable: 35,213,247 bytes in 42,771 blocks
==31708==         suppressed: 2,492 bytes in 39 blocks
==31708== Reachable blocks (those to which a pointer was found) are not shown.
==31708== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==31708== 
==31708== For counts of detected and suppressed errors, rerun with: -v
==31708== Use --track-origins=yes to see where uninitialised values come from
==31708== ERROR SUMMARY: 500 errors from 477 contexts (suppressed: 13 from 7)

Thanks for your help.
valgrind.out.ROOTBuildWithClang.txt (930 KB)

Hi,
Those are real issues coming from the version of clang that ROOT uses. Soon we will upgrade (in a week or so) to newer version of both llvm and clang and this issue should be fixed.
Cheers,
Vassil

Hi,

Update done, let us know what you see! Thanks for your reports!

Cheers, Axel.

ROOT 5.99/05 (heads/master@v5-99-05-251-gec3e301, Feb 22 2014, 12:23:21 on linuxx8664gcc)

Sorry, it has not changed with llvm/clang update.

==27812== LEAK SUMMARY:
==27812==    definitely lost: 920 bytes in 1 blocks
==27812==    indirectly lost: 80 bytes in 3 blocks
==27812==      possibly lost: 243,404 bytes in 2,087 blocks
==27812==    still reachable: 37,368,243 bytes in 47,019 blocks
==27812==         suppressed: 4,900 bytes in 77 blocks
==27812== Reachable blocks (those to which a pointer was found) are not shown.
==27812== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==27812== 
==27812== For counts of detected and suppressed errors, rerun with: -v
==27812== Use --track-origins=yes to see where uninitialised values come from
==27812== ERROR SUMMARY: 495 errors from 472 contexts (suppressed: 25 from 19)

valgrind.out.txt (944 KB)

ROOT 5.99/06 (heads/master@v5-99-06-794-ge89dd01, May 23 2014, 12:44:36 on linuxx8664gcc)

compiled with

gcc-4.9 (Debian 4.9-20140411-2) 4.9.0 20140411 (prerelease) [gcc-4_9-branch revision 209311]

on

x86_64 / Debian stable / Linux 3.14.0-rc6

==3091== LEAK SUMMARY:
==3091==    definitely lost: 3,808 bytes in 28 blocks
==3091==    indirectly lost: 39,840 bytes in 60 blocks
==3091==      possibly lost: 117,273 bytes in 1,431 blocks
==3091==    still reachable: 47,996,595 bytes in 110,431 blocks
==3091==         suppressed: 38,134 bytes in 680 blocks
==3091== Reachable blocks (those to which a pointer was found) are not shown.
==3091== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==3091== 
==3091== For counts of detected and suppressed errors, rerun with: -v
==3091== Use --track-origins=yes to see where uninitialised values come from
==3091== ERROR SUMMARY: 328 errors from 287 contexts (suppressed: 110 from 110)

valgrind.out.txt (535 KB)