ROOT Version:
Not Provided
Platform:
Not Provided
Compiler:
Not Provided
Hi. We have a macro and when we run it (on the same or on different machines) we sometimes get a “corrupted size vs. prev_size” at the end of the execution (and ROOT stops abruptly). We checked "delete"s and directories and we tried using Valgrind but we can’t understand the log (it seems complaining about bytes and .so but it is enigmatic). We have only one version of our custom classes and we tried deleting all .d-.so-.Aclic and compile everything again. We also tried gROOT->Reset(). I attach the full log and I copy here some pieces that seems to repeat themselves in the log (maybe for loops?).
==4903== Invalid write of size 8
==4903== at 0x5A16242: TObject::TObject() (in /home/elisa/root/lib/libRIO.so.6.22.06)
==4903== by 0x1ACCAE1D: ??? (in /home/elisa/Desktop/tans-ricostruzione/Intpoint_cpp.so)
==4903== by 0x1C211FD1: ricostruzione1() (ricostruzione1.cpp:91)
==4903== by 0x1AE85065: ???
==4903== by 0x617E663: cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61064A6: cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x6107DAC: cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61080C8: cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61D125C: cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x605C17B: HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x607360B: TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x6073B15: TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x4A30FA9: TApplication::ExecuteFile(char const*, int*, bool) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x4A31CF1: TApplication::ProcessLine(char const*, bool, int*) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x4862165: TRint::ProcessLineNr(char const*, char const*, int*) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x48639FC: TRint::Run(bool) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x10917F: main (in /home/elisa/root/bin/root.exe)
==4903== Address 0x19027500 is 0 bytes after a block of size 80 alloc'd
==4903== at 0x483CFE3: operator new(unsigned long) (vg_replace_malloc.c:422)
==4903== by 0x4A800ED: TStorage::ObjectAlloc(unsigned long) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x1ACCBD04: ??? (in /home/elisa/Desktop/tans-ricostruzione/Intpoint_cpp.so)
==4903== by 0x1C211F24: ricostruzione1() (ricostruzione1.cpp:88)
==4903== by 0x1AE85065: ???
==4903== by 0x617E663: cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61064A6: cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x6107DAC: cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61080C8: cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61D125C: cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x605C17B: HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x607360B: TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x6073B15: TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x4A30FA9: TApplication::ExecuteFile(char const*, int*, bool) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x4A31CF1: TApplication::ProcessLine(char const*, bool, int*) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x4862165: TRint::ProcessLineNr(char const*, char const*, int*) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x48639FC: TRint::Run(bool) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x10917F: main (in /home/elisa/root/bin/root.exe)
==4903==
==4903== Invalid read of size 4
==4903== at 0x4864BB4: TStorage::UpdateIsOnHeap(unsigned int const volatile&, unsigned int volatile&) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x5A1624A: TObject::TObject() (in /home/elisa/root/lib/libRIO.so.6.22.06)
==4903== by 0x1ACCAE1D: ??? (in /home/elisa/Desktop/tans-ricostruzione/Intpoint_cpp.so)
==4903== by 0x1C211FD1: ricostruzione1() (ricostruzione1.cpp:91)
==4903== by 0x1AE85065: ???
==4903== by 0x617E663: cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61064A6: cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x6107DAC: cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61080C8: cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61D125C: cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x605C17B: HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x607360B: TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x6073B15: TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x4A30FA9: TApplication::ExecuteFile(char const*, int*, bool) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x4A31CF1: TApplication::ProcessLine(char const*, bool, int*) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x4862165: TRint::ProcessLineNr(char const*, char const*, int*) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x48639FC: TRint::Run(bool) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x10917F: main (in /home/elisa/root/bin/root.exe)
==4903== Address 0x19027508 is 8 bytes after a block of size 80 alloc'd
==4903== at 0x483CFE3: operator new(unsigned long) (vg_replace_malloc.c:422)
==4903== by 0x4A800ED: TStorage::ObjectAlloc(unsigned long) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x1ACCBD04: ??? (in /home/elisa/Desktop/tans-ricostruzione/Intpoint_cpp.so)
==4903== by 0x1C211F24: ricostruzione1() (ricostruzione1.cpp:88)
==4903== by 0x1AE85065: ???
==4903== by 0x617E663: cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61064A6: cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x6107DAC: cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61080C8: cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x61D125C: cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x605C17B: HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x607360B: TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x6073B15: TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in /home/elisa/root/lib/libCling.so.6.22.06)
==4903== by 0x4A30FA9: TApplication::ExecuteFile(char const*, int*, bool) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x4A31CF1: TApplication::ProcessLine(char const*, bool, int*) (in /home/elisa/root/lib/libCore.so.6.22.06)
==4903== by 0x4862165: TRint::ProcessLineNr(char const*, char const*, int*) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x48639FC: TRint::Run(bool) (in /home/elisa/root/lib/libRint.so.6.22.06)
==4903== by 0x10917F: main (in /home/elisa/root/bin/root.exe)
Thanks (and sorry, we are new to Valgrind and ROOT). If you need code/headers…let me know.
val.zip
(43.8 KB)
Hi
@EVTO
,
did you run with
--suppressions=$ROOTSYS/etc/valgrind.supp
? There are a lot of known false positives with valgrind and the interpreter that are safe to ignore, the
--suppressions
does that.
Cheers,
Enrico
Hi. I used
valgrind --num-callers=30 --suppressions=$ROOTSYS/etc/valgrind-root.supp --log-file=val.log root.exe -l -q ricostruzione1.cpp+g
Thanks
I cannot tell what’s wrong from the valgrind logs. Most errors originate in
Intpoint_cpp.so
which has been compiled without debug symbols. The first thing to do would be to produce a version of
Intpoint_cpp.so
with debug symbols and get a more complete valgrind log.
If that is still inconclusive, you can try to inspect what’s going on at the point of crash with a debugger:
gdb --args root.exe -l -q ricostruzione1.cpp+g
(and then enter
run
inside the debugger, see also
http://www.gdbtutorial.com
).
If that is still inconclusive, please post a minimal reproducer that we can run and debug.
Cheers,
Enrico
eguiraud:
The first thing to do would be to produce a version of
Intpoint_cpp.so
with debug symbols and get a more complete valgrind log.
Sorry, how?
(Intpoint is a class, I have header and .cxx)
Thanks a lot
Uhm, the
g
in
"kg"
means that
Intpoint.cpp
should be compiled with debug symbols, but that does not seem to be the case, or at least valgrind can’t figure out at what line in Intpoint.cpp the problematic code resides.
You can try to re-generate the library it manually with
g++ -g -fPIC -shared -o Intpoint_cpp.so Intpoint.cpp $(root-config --libs --cflags)
.
Hi. I’m trying using gdb (the error occurs only once in almost 30 runs on my laptop and re-generating the library gave no useful clue so I think I must try with the debugger until I come across a lucky run).
Should I use
gdb root.exe
(gdb) run ricostruzione1.cpp+g
(gdb) bt
to obtain a valuable error log? Are there better commands?
Thanks a lot
Hi, you can use
gdb --args root.exe ricostruzione1.cpp+g
, then inside
gdb
run
and
bt
at the point of crash.
There is also a trick to run the program in a loop until you get a crash:
(gdb) run # run the program once
[Inferior 1 (process 227900) exited normally]
(gdb) break exit
Breakpoint 1 at 0x7fff6db29140 (3 locations)
(gdb) commands
Type commands for breakpoint(s) 1, one per line.
End with a line saying just "end".
(gdb) run # now the program runs in a loop
This puts a breakpoint when the exit system call is called (i.e. at the end of a well-behaved execution) and then tells gdb to execute run every time that breakpoint is hit – in practice restarting the program whenever it completes successfully.
Feel free to share code and data so we can take a look directly in case this does not help either (but having some familiarity with a debugger is always useful in any case )