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

TUnixSystem / TFile::Open() does not handle ~invaliduser/file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.06/08
    • Fix Version/s: 6.06/10, 6.10/00, 6.08/04
    • Component/s: None
    • Labels:
      None
    • Environment:

      unix

      Description

      Running

      TFile::Open("~invaliduser/file", "READ");

      unexpectedly throws an std::logic_error, backtrace:

      #3  0x00007ffff6617256 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) () from /home/basf2/externals/v01-03-01/Linux_x86_64/com-mon/lib64/libstdc++.so.6
      #4  0x00007ffff5c3ea85 in TUnixSystem::GetHomeDirectory(char const*) const () from /home/basf2/externals/-v01-03-01/Linux_x86_64/opt/root/lib/libCore.so
      #5  0x00007ffff5b906e8 in TSystem::ExpandFileName(char const*, char*, int) () from /home/basf2/externals/-v01-03-01/Linux_x86_64/opt/root/lib/libCore.so
      #6  0x00007ffff5b90979 in TSystem::ExpandFileName(TString&) () from /home/basf2/externals/v01-03-01/Linux-_x86_64/opt/root/lib/libCore.so
      #7  0x00007ffff56c6da5 in TFile::Open(char const*, char const*, char const*, int, int) () from /home/basf-2/externals/v01-03-01/Linux_x86_64/opt/root/lib/libRIO.so

      It looks like TUnixSystem::GetHomeDirectory() constructs a string from a null-pointer, which causes the exception. If my understanding of the standard is correct, this is actually undefined behaviour (and the STL is playing nice here).

        Attachments

          Activity

            People

            • Assignee:
              pcanal Philippe Canal
              Reporter:
              1a6d63d41e0230d528a8 Christian Pulvermacher
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual Start:
                Actual End: