You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to read the entire file until the end of file with the file cache then it can either fail with an error, or silently return more data than is in the source file:
$ XRD_LOGLEVEL=Error wc /stash/pnfs/fnal.gov/usr/nova/data/flux/gsimple/nova_v06/nd/mn/rhc/gsimple_NOvA-ND_mn000z-200i_rp11_bs1.1_pnut_lowth_f11f093bbird_target_q52_00001.root
[2015-07-06 14:47:30.029650 -0500][Error ][XRootD ] [mwt2-stashcache.campuscluster.illinois.edu:1094] Overflow data while reading response to kXR_read (handle: 0x00000000, offset: 346235956, size: 16384): expected: 16384, got 17146 bytes
[2015-07-06 14:47:30.029839 -0500][Error ][XRootD ] [mwt2-stashcache.campuscluster.illinois.edu:1094] Handling response to kXR_read (handle: 0x00000000, offset: 346235956, size: 16384): user supplied buffer is too small for the received data.
[2015-07-06 14:47:30.029875 -0500][Error ][File ] [0x1b68af0@root://mwt2-stashcache.campuscluster.illinois.edu:1094//pnfs/fnal.gov/usr/nova/data/flux/gsimple/nova_v06/nd/mn/rhc/gsimple_NOvA-ND_mn000z-200i_rp11_bs1.1_pnut_lowth_f11f093bbird_target_q52_00001.root] Fatal file state error. Message kXR_read (handle: 0x00000000, offset: 346235956, size: 16384) returned with [ERROR] Invalid response
wc: /stash/pnfs/fnal.gov/usr/nova/data/flux/gsimple/nova_v06/nd/mn/rhc/gsimple_NOvA-ND_mn000z-200i_rp11_bs1.1_pnut_lowth_f11f093bbird_target_q52_00001.root: Bad message
1211905 7186282 346235956 /stash/pnfs/fnal.gov/usr/nova/data/flux/gsimple/nova_v06/nd/mn/rhc/gsimple_NOvA-ND_mn000z-200i_rp11_bs1.1_pnut_lowth_f11f093bbird_target_q52_00001.root
In XrdFileCache/XrdFileCacheIOEntireFile.cc IOEntireFile::Read(), if the call to m_prefetch->Read(buff, off, size); returns less data than size because it's at the end of the file, then the number of bytes actually read is added to bytes_read twice, the first time at line 97, then the second time at line 106.
The corresponding function in XrdFileCache/XrdFileCacheIOFileBlock.cc also appears to be incorrect in this situation, although in a different way: if the actual bytes read doesn't equal the requested read size it returns the size of the final read, regardless of any data it may have previously put into the buffer from previous calls to read.
The text was updated successfully, but these errors were encountered:
Thanks for the report. I see the problem in IOEntireFile::Read().
From the report it is not clear to me how did you test file caching plugin by exporting only LD_PRELOAD and XROOTD_VMP. As I understand LD_PRELOAD=/usr/lib64/libXrdPosixPreload.so enables posix like interface, but does enables file caching.
If you try to read the entire file until the end of file with the file cache then it can either fail with an error, or silently return more data than is in the source file:
or
In XrdFileCache/XrdFileCacheIOEntireFile.cc IOEntireFile::Read(), if the call to
m_prefetch->Read(buff, off, size);
returns less data thansize
because it's at the end of the file, then the number of bytes actually read is added tobytes_read
twice, the first time at line 97, then the second time at line 106.The corresponding function in XrdFileCache/XrdFileCacheIOFileBlock.cc also appears to be incorrect in this situation, although in a different way: if the actual bytes read doesn't equal the requested read size it returns the size of the final read, regardless of any data it may have previously put into the buffer from previous calls to read.
The text was updated successfully, but these errors were encountered: