Read Valgrind log


Please read tips for efficient and successful posting and posting code

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

Hi,
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

Sorry, how? :see_no_evil: (Intpoint is a class, I have header and .cxx)
Thanks a lot

How did you produce Intpoint_cpp.so (i.e. a compiled version of your Intpoint.cpp file)? I don’t think root.exe -l -q ricostruzione1.cpp+g produces that file (or does it?).


We used this macro to compile all classes and macros at the same time. It produces all .so-.Aclic-.d

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".
>run
>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 :slight_smile: )

Cheers,
Enrico

The valgrind log mentions the function UpdateIsOnHeap which had some issues that were fixed via [core/base] Clang-tidy Clazy Warnings · Issue #7412 · root-project/root · GitHub

Can you retry with the latest ROOT version?

Also, consider using this for better understanding/parsing the valgrind logs:

See also Debugging a ROOT macro

Hi. Thanks a lot. We will install the latest ROOT version and try again both valgrind and gdb and we will consult these links. If we can’t solve our problem we will cut our macro so that you must not try to read hundreds of lines of code :smiling_face:

2 Likes

Hi. Sorry for the late reply. We found the incriminated line ( but we can’t understand why).
We open a file and “link” it to hfilerec, then we do something ,finally we save a tree to the file, with hfilerec->ls we can see that the tree is in the file but the last line, hfilerec->Close(), causes the “corrupted size vs. prev_size” error on one of the laptops

image
Why? :sob: Thanks a lot

Hi @EVTO ,

hard to say without a reproducer. My educated guess is that hfilerec->Close() tries to delete some object that has already been deleted, or something similar. TFiles often own the objects contained it them (so it thinks that when it gets closed, those objects can go away), but sometimes these objects are also deleted by other code!

Cheers,
Enrico

Hi. We wrote a minimal reproducer. if you could take a look…

//root includes
#include "TH1D.h"
#include "TVirtualFFT.h"
#include "TF1.h"
#include "TMath.h"
#include "TCanvas.h"
#include <iostream>
#include "TString.h"
#include "TFile.h"
#include "TTree.h"
#include "TSystem.h"
#include "TTreeReader.h"
#include "TTreeReaderValue.h"
#include "TRandom3.h"
#include "TClonesArray.h"
#include "TGraph2D.h"
#include  <vector>
#include <fstream>
#include <TDirectory.h>

//headers include
#include "Vertex.h"
#include "Intpoint.h"

using namespace std;

const int limit1=17;
const int limit2=21;

void ricprova(){  
  
 //file and trees
  TFile *hfile = TFile::Open("simulazione.root", "READ");
  if(hfile==NULL){
    cout<<"Errore, non esiste il file"<<endl; 
    return;
  }	
  hfile->ls();
  TTree *treelec = (TTree*)hfile->Get("tree");
  if(treelec==NULL){ 
    cout<<"Errore, non esiste il tree"<<endl; 
    return;
  }
   
  TFile *hfilerec = TFile::Open("ricostruzione.root","RECREATE"); 
  TTree *treerec = new TTree("treerec", "ricostruzione");
  //histo
  TH1D *zintisto = new TH1D("zrec","z",12,-6,6);
  //branches
  TClonesArray *intprec1 = new TClonesArray("Intpoint", 100);
  TClonesArray *intprec2 = new TClonesArray("Intpoint", 100);
  TClonesArray &int1 = *intprec1;  
  TClonesArray &int2 = *intprec2;
 
  Vertex *verrec = NULL;
  int acceptedrec;	
  
  treerec->Branch("Vertexreal",&verrec);
    treerec->Branch("int1+noise",&intprec1);
  treerec->Branch("int2+noise",&intprec2);
  treerec->Branch("accept",&acceptedrec);
  
  //read treelec
  TClonesArray *clone1= new TClonesArray("Intpoint",100);
  TClonesArray *clone2= new TClonesArray("Intpoint",100);
  for (int i=1;i<10;i++) { 
    new (&clone1[i]) Intpoint (0,0,0); 
    new (&clone2[i]) Intpoint (0,0,0);
  } 
   
  int accepted;
  Vertex *verlec = new Vertex(); 
   
  TBranch *b3=treelec->GetBranch("accept");
  b3->SetAddress(&accepted);
  TBranch *b4=treelec->GetBranch("Vertext");
  b4->SetAddress(&verlec);
 
  //loop on events
  for(int ev=0;ev<treelec->GetEntries();ev++){
     zintisto->Reset("ICES");
    verlec->Clearvec();
    delete verrec;	  
   
    treelec->GetEntry(ev);
      
    verrec = new Vertex(*verlec);
    acceptedrec=accepted;
     for (int i=0; i<30;i++) zintisto->Fill((gRandom->Rndm()*12)-6);	  
    new TCanvas; 
    zintisto->DrawCopy(); 
      treerec->Fill();
     	
  
  }

  hfilerec-> cd(); 
  treerec->Write(); 
  hfilerec->Close();
}

If you need to run it, here are classes and file
Vertex.cpp (1.2 KB)
Vertex.h (464 Bytes)
Intpoint.h (306 Bytes)
Intpoint.cpp (870 Bytes)
simulazione.root (18.8 KB)
Thanks a lot

I do not know whether this is the problem but instead of:

  for (int i=1;i<10;i++) { 
    new (&clone1[i]) Intpoint (0,0,0); 

try

  for (int i=0;i<10;i++) { 
    new (&clone1[i]) Intpoint (0,0,0); 

I also see:

  for(int ev=0;ev<treelec->GetEntries();ev++) {
...
    new TCanvas; 
    zintisto->DrawCopy(); 
...
  }

Do you really mean to create a new TCanvas per entry and a new histogram for every single entry of the input TTree? If you have a lot of entries in the input TTree you might be running out of memory and/our computing resources.

Hi. Still crashes with for (int i=0;i<10;i++) (and we use this for cycle only to address a branch to a TClone to read the tree (if we use a void TClone, we get a valgrind warning about linking a branch to something with 0 dimension), it’s a quite useless cycle).
We need a TCanvas for every event (int ev), but we only have 20 tree entries so 1 histogram, 20 canvasses: I hope a laptop could handle that

Hi @EVTO ,

I can reproduce a crash at teardown, and I think it’s just a consequence of out of bound writes during I/O.

Here’s what valgrind has to say:

==422755== Invalid write of size 8
==422755==    at 0x4B187A5: TObject::TObject() (TObject.h:241)
==422755==    by 0x70A5704: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:19)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b500 is 0 bytes after a block of size 80 alloc'd
==422755==    at 0x4846003: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==422755==    by 0x4B88CC7: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:330)
==422755==    by 0x10AC02: TObject::operator new(unsigned long) (TObject.h:167)
==422755==    by 0x10A5D4: ricprova() (ricprova.C:64)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==
==422755== Invalid write of size 4
==422755==    at 0x4B187AC: TObject::TObject() (TObject.h:241)
==422755==    by 0x70A5704: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:19)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b50c is 12 bytes after a block of size 80 alloc'd
==422755==    at 0x4846003: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==422755==    by 0x4B88CC7: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:330)
==422755==    by 0x10AC02: TObject::operator new(unsigned long) (TObject.h:167)
==422755==    by 0x10A5D4: ricprova() (ricprova.C:64)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==
==422755== Invalid read of size 4
==422755==    at 0x4B186DE: TStorage::FilledByObjectAlloc(unsigned int const volatile*) (TStorage.h:119)
==422755==    by 0x4B18705: TStorage::UpdateIsOnHeap(unsigned int const volatile&, unsigned int volatile&) (TStorage.h:132)
==422755==    by 0x4B187CD: TObject::TObject() (TObject.h:245)
==422755==    by 0x70A5704: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:19)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b508 is 8 bytes after a block of size 80 alloc'd
==422755==    at 0x4846003: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==422755==    by 0x4B88CC7: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:330)
==422755==    by 0x10AC02: TObject::operator new(unsigned long) (TObject.h:167)
==422755==    by 0x10A5D4: ricprova() (ricprova.C:64)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==
==422755== Invalid read of size 4
==422755==    at 0x4B18723: TStorage::UpdateIsOnHeap(unsigned int const volatile&, unsigned int volatile&) (TStorage.h:135)
==422755==    by 0x4B187CD: TObject::TObject() (TObject.h:245)
==422755==    by 0x70A5704: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:19)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b50c is 12 bytes after a block of size 80 alloc'd
==422755==    at 0x4846003: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==422755==    by 0x4B88CC7: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:330)
==422755==    by 0x10AC02: TObject::operator new(unsigned long) (TObject.h:167)
==422755==    by 0x10A5D4: ricprova() (ricprova.C:64)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==
==422755== Invalid write of size 4
==422755==    at 0x4B18730: TStorage::UpdateIsOnHeap(unsigned int const volatile&, unsigned int volatile&) (TStorage.h:135)
==422755==    by 0x4B187CD: TObject::TObject() (TObject.h:245)
==422755==    by 0x70A5704: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:19)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b50c is 12 bytes after a block of size 80 alloc'd
==422755==    at 0x4846003: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==422755==    by 0x4B88CC7: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:330)
==422755==    by 0x10AC02: TObject::operator new(unsigned long) (TObject.h:167)
==422755==    by 0x10A5D4: ricprova() (ricprova.C:64)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==
==422755== Invalid write of size 4
==422755==    at 0x4B187D2: TObject::TObject() (TObject.h:247)
==422755==    by 0x70A5704: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:19)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b508 is 8 bytes after a block of size 80 alloc'd
==422755==    at 0x4846003: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==422755==    by 0x4B88CC7: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:330)
==422755==    by 0x10AC02: TObject::operator new(unsigned long) (TObject.h:167)
==422755==    by 0x10A5D4: ricprova() (ricprova.C:64)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==
==422755== Invalid write of size 8
==422755==    at 0x70A5714: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:19)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b500 is 0 bytes after a block of size 80 alloc'd
==422755==    at 0x4846003: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==422755==    by 0x4B88CC7: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:330)
==422755==    by 0x10AC02: TObject::operator new(unsigned long) (TObject.h:167)
==422755==    by 0x10A5D4: ricprova() (ricprova.C:64)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==
==422755== Invalid write of size 8
==422755==    at 0x70A5720: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:20)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b510 is 16 bytes after a block of size 80 alloc'd
==422755==    at 0x4846003: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==422755==    by 0x4B88CC7: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:330)
==422755==    by 0x10AC02: TObject::operator new(unsigned long) (TObject.h:167)
==422755==    by 0x10A5D4: ricprova() (ricprova.C:64)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==
==422755== Invalid write of size 8
==422755==    at 0x70A572E: Intpoint::Intpoint(double, double, double) (Intpoint.cpp:21)
==422755==    by 0x10A693: ricprova() (ricprova.C:67)
==422755==    by 0x10AB49: main (ricprova.C:103)
==422755==  Address 0x1a65b518 is 24 bytes after a block of size 80 in arena "client"
==422755==

@pcanal it looks like I/O of these classes is broken. @EVTO did you modify these classes since you wrote them to simulazione.root?

Hi @eguiraud. We didn’t modify classes, we only have one class version and we always recreate file simulazione.root before using this macro (we have two macros, one for creating the file, one for reading the tree, and we always compile and run both together to avoid inconsistencies)