Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xrdcp scrambles destination path #925

Closed
rodwalker opened this issue Mar 12, 2019 · 1 comment
Closed

xrdcp scrambles destination path #925

rodwalker opened this issue Mar 12, 2019 · 1 comment

Comments

@rodwalker
Copy link

Hi,
On CentOS7, and using the file:// prefix for the destination, when the path is long it gets scrambled. xrdcp has zero exitcode but the file is in some random place(but determined by dest path).

xrdcp -vf root://atlasxrootd-kit.gridka.de:1094//pnfs/gridka.de/atlas/disk-only/atlasdatadisk/rucio/mc16_13TeV/26/a8/HITS.14859379._044566.pool.root.1 file:///tmp/walkerr/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/mc16_13TeV/1234567890123
[73.94MB/73.94MB][100%][==================================================][36.97MB/s]
[lxplus080] rucio $ ls -l /tmp/walkerr/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/mc16_13TeV/1234567890123
ls: cannot access /tmp/walkerr/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/mc16_13TeV/1234567890123: No such file or directory

One character less on the destination works
file:///tmp/walkerr/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/mc16_13TeV/123456789012
This is 128 chars which might be suspicious.

Also removing 'file://' works. Above is the case for
/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/xrootd/4.8.5-x86_64-centos7/v4.8.5/bin/xrdcp

With
/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/xrootd/4.9.0-x86_64-centos7/v4.9.0/bin/xrdcp
it fails with dest
/tmp/walkerr/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/mc16_13TeV/HITS.14859379._044566.pool.root.1.part
but I don`t find a simple string length threshold.
This file is written to
/tmp/walkerr/d1234567890/d1234567890/d1234567890/d1234567890/d1234567890/7890/d1234567890/mc16_13TeV/HITS.148593794859379._044566.pool.root.1.part

NB. scrambled at /7890/

On SL6, both respective versions work, eg.
/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/xrootd/4.9.0-x86_64-slc6/v4.9.0/bin/xrdcp

I am not sure if 'file://' is even fully supported, so we will remove that anyway. It is not in the man page, but mostly works. I think it should be fixed or formally dropped and give an error.

Cheers,
Rod.

@simonmichal
Copy link
Contributor

Hi Rod,

Thank you for reporting this problem. Regarding your question whether we support file://: yes we do.

The problem is that in here:

else if (*pP == '/') strcpy(Path, pP);

the parameters of strcpy are overlapping buffers which results with undefined behaviour (probably strcpy implementation on slc6 is bit different and that's why it works on slc6).

I will push a bugfix on Monday and include it in next bugfix release.

Again, thanks for reporting!

Cheers,
Michal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants