News about ROOT6-Cling + Valgrind?

Hi everyone,

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

compiled with :

g++ -o test `root-config --cflags --libs` test.cc

is still producing some valgrind “possibly lost” warnings :

valgrind test 2> valgrind.out.txt

I have put the complete valgrind.out.txt in attachment. This is just the summary :

==9167== LEAK SUMMARY:
==9167==    definitely lost: 0 bytes in 0 blocks
==9167==    indirectly lost: 0 bytes in 0 blocks
==9167==      possibly lost: 283,453 bytes in 3,322 blocks
==9167==    still reachable: 27,293,910 bytes in 53,688 blocks
==9167==         suppressed: 38,438 bytes in 550 blocks
==9167== Reachable blocks (those to which a pointer was found) are not shown.
==9167== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==9167== 
==9167== For counts of detected and suppressed errors, rerun with: -v
==9167== Use --track-origins=yes to see where uninitialised values come from
==9167== ERROR SUMMARY: 306 errors from 272 contexts (suppressed: 654 from 163)

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

My system is :
Linux 3.16-2-amd64 #1 SMP Debian 3.16.3-2 (2014-09-20) x86_64 GNU/Linux
g++ (Debian 4.9.1-16) 4.9.1
ROOT commit a2e77b71981ad181cd3bbded3ca5022f674614f4 (Date: Tue Oct 7 11:25:17 2014 +0200)

As these are just “possibly lost” warnings (contrary as in my last post in February [url]Cant migrate to ROOT6beta2 because of valgrind warnings ) , I can now use valgrind with the flag :

--show-possibly-lost=no 

but it’s not satisfactory…

Is it possible to get rid of these warnings (with perhaps a temporary valgrind suppression file ?)

Thanks in advance…
valgrind.out.txt (517 KB)

Hi,

How is it not satisfactory? You are welcome to send us such an suppression file for the possibly lost ones for us to add it as a new file.

Note that I don’t see the valgrind error in the ASTReader anymore.

Cheers, Axel.

I see that you have updated ./etc/valgrind-root.etc with this commit f3afd11c19aa616e193388e25c785682984e0d53
I did not know how to do it, and did not even know if it was a serious bug or something harmless.
Can you tell me if it is what I should obtain ?

==26990== Memcheck, a memory error detector
==26990== Copyright © 2002-2013, and GNU GPL’d, by Julian Seward et al.
==26990== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==26990== Command: ./a.out
==26990==
==26990== Conditional jump or move depends on uninitialised value(s)
==26990== at 0xA7B918B: clang::ASTDeclReader::VisitFriendDecl(clang::FriendDecl*) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xA7BF6C4: clang::declvisitor::Base<clang::declvisitor::make_ptr, clang::ASTDeclReader, void>::Visit(clang::Decl*) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xA7BF862: clang::ASTDeclReader::Visit(clang::Decl*) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xA7BFC90: clang::ASTReader::ReadDeclRecord(unsigned int) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xA7734BC: clang::ASTReader::GetDecl(unsigned int) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xA774234: (anonymous namespace)::FindExternalLexicalDeclsVisitor::visit(clang::serialization::ModuleFile&, bool, void*) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xA822989: clang::serialization::ModuleManager::visitDepthFirst(bool ()(clang::serialization::ModuleFile&, bool, void), void*) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xA767420: clang::ASTReader::FindExternalLexicalDecls(clang::DeclContext const*, bool ()(clang::Decl::Kind), llvm::SmallVectorImplclang::Decl*&) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xAECDE32: clang::DeclContext::LoadLexicalDeclsFromExternalStorage() const (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xAECDEEE: clang::DeclContext::decls_begin() const (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xAF77EAF: clang::ASTContext::getCurrentKeyFunction(clang::CXXRecordDecl const
) (in /home/kulam/local/lib/root/libCling.so)
==26990== by 0xAACA702: clang::Sema::ActOnEndOfTranslationUnit() (in /home/kulam/local/lib/root/libCling.so)
==26990==
==26990==
==26990== HEAP SUMMARY:
==26990== in use at exit: 23,379,933 bytes in 51,649 blocks
==26990== total heap usage: 159,617 allocs, 107,968 frees, 102,978,600 bytes allocated
==26990==
==26990== LEAK SUMMARY:
==26990== definitely lost: 0 bytes in 0 blocks
==26990== indirectly lost: 0 bytes in 0 blocks
==26990== possibly lost: 329,507 bytes in 2,723 blocks
==26990== still reachable: 23,011,780 bytes in 48,374 blocks
==26990== suppressed: 38,646 bytes in 552 blocks
==26990== Reachable blocks (those to which a pointer was found) are not shown.
==26990== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==26990==
==26990== For counts of detected and suppressed errors, rerun with: -v
==26990== Use --track-origins=yes to see where uninitialised values come from
==26990== ERROR SUMMARY: 284 errors from 250 contexts (suppressed: 662 from 162)

Thanks for your help
Cheers,

My system is :
Linux 3.16-3-amd64 #1 SMP Debian 3.16.5-1 (2014-10-10) x86_64 GNU/Linux
g++ (Debian 4.9.1-19) 4.9.1
ROOT commit c2d1b3b7d4aa06e6b08923bcbe68105429dac716

Hi,

definitely lost (with the suppressions file valgrind-root.supp) should be 0. It is for me.

I cannot reproduce the error in clang::ASTDeclReader::VisitFriendDecl() anymore. How did you build, which commit of ROOT do you use - still c2d1b3b7d4aa06e6b08923bcbe68105429dac716? I cannot even find that one… which branch is it supposed to be in?

Cheers, Axel.

git clone =>stay in branch master

commit c2d1b3b7d4aa06e6b08923bcbe68105429dac716
Author: Philippe Canal pcanal@fnal.gov
Date: Fri Oct 31 17:25:17 2014 -0500

enable C++14 on more platforms

I have build with configure (since it has never been possible for me to build with cmake , see [url]Cannot compile with cmake (never was able to) )

my config status :

linuxx8664gcc --prefix=/home/kulam/local --etcdir=/home/kulam/local/etc/root --enable-minuit2

my system :

My system is :
Linux 3.16-3-amd64 #1 SMP Debian 3.16.5-1 (2014-10-10) x86_64 GNU/Linux
g++ (Debian 4.9.1-19) 4.9.1

Cheers,

Hi,

I had yet another look at valgrind’s report on ASTReader::VisitFriendDecl() which is the only part that is still relevant in valgrind’s output. It’s only visible in optimized mode. I cannot see anything wrong with the code; the values and the code paths are correct. So I suspect that it’s a false positive in valgrind, possibly due to the value in question being 32bits wide.

So there’s nothing to be fixed here.

Cheers, Axel.

Not a false positive - finally fixed! (In a future 6.06 and 6.08 patch release as well as the master.)
Axel.