Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9535

Unexpected crash when cloning TH2 histogram

    XMLWordPrintable

    Details

      Description

      We have encountered a very strange error/crash with ROOT that results in the following (truncated) stack trace:

      #24 0x00007ff7273d22d5 in TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #25 0x00007ff7273d4916 in TBufferFile::WriteClassBuffer(TClass const*, void*) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #26 0x00007ff71c6b7d3b in TH2D::Streamer(TBuffer&) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libHist.so
      #27 0x00007ff7273d839c in TBufferFile::WriteObjectClass(void const*, TClass const*, bool) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #28 0x00007ff7273d32a6 in TBufferFile::WriteObjectAny(void const*, TClass const*, bool) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #29 0x00007ff7273d2765 in TBufferFile::WriteFastArray(void**, TClass const*, int, bool, TMemberStreamer*) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #30 0x00007ff7275792ca in int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #31 0x00007ff72746034d in TStreamerInfoActions::GenericWriteAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #32 0x00007ff7273d22d5 in TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #33 0x00007ff7273d4916 in TBufferFile::WriteClassBuffer(TClass const*, void*) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #34 0x00007ff71be6845b in TPaveStats::Streamer(TBuffer&) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libGraf.so
      #35 0x00007ff7273d839c in TBufferFile::WriteObjectClass(void const*, TClass const*, bool) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #36 0x00007ff7273d32a6 in TBufferFile::WriteObjectAny(void const*, TClass const*, bool) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #37 0x00007ff7290a75e1 in TList::Streamer(TBuffer&) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libCore.so
      #38 0x00007ff7274029f3 in TDirectoryFile::CloneObject(TObject const*, bool) () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libRIO.so
      #39 0x00007ff72909724e in TCollection::Clone(char const*) const () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libCore.so
      #40 0x00007ff71c688ca3 in TH1::Clone(char const*) const () from /cvmfs/atlas.cern.ch/repo/sw/software/21.2/sw/lcg/releases/ROOT/6.12.06-0f687/x86_64-slc6-gcc62-opt/lib/libHist.so 

      A minimal reproducer for this crash is the following code - it seems like even reordering the code slightly can prevent the crash, but to our eyes we cannot see anything that is actually wrong with the code...

       
      {    
      TFile f1("myTrees.root");    
      TTree * physicsNominal = (TTree *)f1.Get("physicsNominal");
          
      TTree * physicsSystematic = (TTree*)f1.Get("physicsSystematic");
      TH2D * migrationNominal = new TH2D ("migrationNominal", "Nominal migration; reco; truth", 2, 0, 3, 2, 0, 3);
          
      physicsNominal->Draw("MCTruthValue:RecoValue>>migrationNominal", "RecoWeight*MCTruthWeight*(MCTruthIsFiducial&&RecoIsReconstructed)");       
       
      TCanvas myCanvas("c","c");
       
      migrationNominal->Draw("COLZ TEXT");
      myCanvas.Draw();
       
      TH2D * migrationSystematic = (TH2D*)migrationNominal->Clone("migrationSystematic");
          physicsSystematic->Draw("MCTruthValue:RecoValue>>migrationSystematic","RecoWeight*MCTruthWeight*(MCTruthIsFiducial&&RecoIsReconstructed)");
          
      migrationSystematic->Draw("COLZ TEXT");
      migrationSystematic->Clone("aaa"); //crash happens here!
       
      } 

      I've attached the ROOT files containing the input TTrees for this minimal example. sorry it has to be this way, it really does seem very subtle and difficult to reproduce exactly.

      Do let us know if you are able to reproduce the error with this example.

      Thanks

      Will

       

       

        Attachments

          Activity

            People

            • Assignee:
              pcanal Philippe Canal
              Reporter:
              will Will Buttinger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: