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

TChain::Add and TChain::AddFile broken with URL that contains double slashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.16/00, 6.14/04, 6.18/04
    • Fix Version/s: 6.22/00
    • Component/s: TTree
    • Labels:
      None
    • Environment:

      LCG releases for SLC6 listed above (LCG 94 or later with ROOT 6.14+)

      Description

      TChain::Add and TChain::AddFile are broken when the provided URL contains double slashes in the path component, eg root://some.domain/path/to//file.root.

      Minimal repro case:

      const char *path = "root://some.domain/path/to//file.root";
      TChain c;
      c.Add(path);
      for (const auto f : *c.GetListOfFiles()) f->Print(); 

      This yields to:

      OBJ: TChainElement root://some.domain/pa

      Notice how the path is truncated (and hence trying to use the TChain doesn't work). For comparison, in ROOT 6.12 (LCG 93) the path is added correctly:

      OBJ: TChainElement root://some.domain/path/to//file.root

      So this is a regression between 6.12 and 6.14.

      This is caused by this code in TChain.cxx: the variable fn contains the normalized path (path/to/file.root in my example). Since the normalized path isn't present in filename, filename.Index(fn) returns -1 and things break down.

      An obvious workaround is to always normalize the URL before adding files.

        Attachments

          Activity

            People

            • Assignee:
              axel Axel Naumann
              Reporter:
              lmoureau Louis Moureaux
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: