microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.48k stars 822 forks source link

Copying files in bash results in some being copied as zero length? #12296

Open bbneo opened 2 hours ago

bbneo commented 2 hours ago

Windows Version

Microsoft Windows [Version 10.0.22631.4460]

WSL Version

WSL version: 2.3.26.0 Kernel version: 5.15.167.4-1 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.22631.4460

Are you using WSL 1 or WSL 2?

Kernel Version

Kernel version: 5.15.167.4-1

Distro Version

Release: 22.04

Other Software

? Google Drive environment

Repro Steps

Source files:

bbanko@WB-PF43HCDT:FilesRun2024-11-19$ find .  -size 0 | sed -e 's/.\///' | sed -E -e 's/_[0-9]{8,}//' | xargs -I filenm ls -sh ../Set2024-11-15/filenm
113M ../Set2024-11-15/69691_4.pdf
116M ../Set2024-11-15/33598_4.pdf
171M ../Set2024-11-15/222093_4.pdf
133M ../Set2024-11-15/224866_4.pdf
162M ../Set2024-11-15/223584_4.pdf
126M ../Set2024-11-15/201807_4.pdf

bbanko@WB-PF43HCDT:FilesRun2024-11-19$ find . -size 0 | sed -e 's/.\///' | sed -E -e 's/_[0-9]{8,}//' | xargs -t -I filenm cp ../Set2024-11-15/filenm . ./Staging cp ../Set2024-11-15/69691_4.pdf ../Staging cp ../Set2024-11-15/33598_4.pdf ../Staging cp ../Set2024-11-15/222093_4.pdf ../Staging cp ../Set2024-11-15/224866_4.pdf ../Staging cp ../Set2024-11-15/223584_4.pdf ../Staging cp ../Set2024-11-15/201807_4.pdf ../Staging

ls -sh ../Staging total 0 0 138808_1.pdf 0 150749_4.pdf 0 201266_4.pdf 0 219336_1.pdf 0 223584_4.pdf 0 45420_1.pdf 0 64388_4.pdf 0 '74234_3 (1).pdf' 0 143064_1.pdf 0 184579_4.pdf 0 201807_4.pdf 0 219594_1.pdf 0 224866_4.pdf 0 45420_2.pdf 0 65469_4.pdf 0 '74234_4 (1).pdf' 0 144432_4.pdf 0 186479_1.pdf 0 203266_1.pdf 0 220073_4.pdf 0 '24168_4 (2).pdf' 0 46111_1.pdf 0 67355_1.pdf 0 148183_1.pdf 0 191582_1.pdf 0 216941_4.pdf 0 222093_4.pdf 0 33598_4.pdf 0 51881_4.pdf 0 69691_4.pdf

Expected Behavior

Just seems to affect certain files... in this case files with sizes 100M to 250M (didn't try any larger files).

Actual Behavior

Files are copied to destination with zero length.

Diagnostic Logs

github-actions[bot] commented 2 hours ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The script will output the path of the log file once done. If this is a networking issue, please use [collect-networking-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1), following the instructions [here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues) Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.