Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: 6.06/08
-
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).