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
The behavior described in the report is observed only on WSL's 9P mounts of Windows disks.
sudo mkdir -p /mnt/c/test cd /mnt/c/test touch 1 2
run the script
#!/bin/bash
# save true file number
true_f_num=$(for fn in *; do echo; done | wc -l)
while :; do
# count of iterations to outer loop pipe
echo
# save current file list in file
echo -n '' >.list
for fn in *; do
echo "$fn" >>.list
# line below causes unexpected behaviour
# on 9P mounts (like /mnt/c/...)
# (WSL2, ubuntu 22.04)
done | cat > .tmp; rm .tmp
# check
[ $(cat .list | wc -l ) -ne $true_f_num ] && break
done | wc -l
output: some random number
cat .list
output:
1
2
2
by default, pathname expansion omits files whose names start with . unless the . is explicitly matched by the pattern. Therefore, in the above code, .tmp is not expected to appear in the expansion of *, regardless of the relative timing of its creation.
in the example command, pathname expansion is expected to be performed, once, before any iterations of the loop body are performed.
it is not expected for pathname expansion to yield duplicate pathnames, because that is not consistent with the Bash or POSIX specifications.
The appearance of duplicate lines in .list indicates that at least one of the previous two expectations is violated. This would be a bug.
Script runs forever.
File .list is populated with an exact list of files on each iteration of the loop.
Actual Behavior
On WSL's 9P mounts of Windows' disks script stops after some random number of iterations, outputs this number.
File .list contains the name of one of the files in the current directory twice.
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 in an administrative powershell prompt:
Once completed please upload the output files to this Github issue.
Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] 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'.
Issue was edited and new log file was found: https://github.com/user-attachments/files/17595981/WslLogs-2024-11-01_06-25-00.zip
Detected appx version: 2.3.24.0
This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.
Windows Version
Microsoft Windows [Version 10.0.19045.5011]
WSL Version
2.3.24.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.153.1-2
Distro Version
Ubuntu 22.04.5
Other Software
No response
Repro Steps
The behavior described in the report is observed only on WSL's 9P mounts of Windows disks.
sudo mkdir -p /mnt/c/test
cd /mnt/c/test
touch 1 2
run the script
output: some random number
cat .list
output:
by default, pathname expansion omits files whose names start with
.
unless the.
is explicitly matched by the pattern. Therefore, in the above code,.tmp
is not expected to appear in the expansion of*
, regardless of the relative timing of its creation.in the example command, pathname expansion is expected to be performed, once, before any iterations of the loop body are performed.
it is not expected for pathname expansion to yield duplicate pathnames, because that is not consistent with the Bash or POSIX specifications.
The appearance of duplicate lines in
.list
indicates that at least one of the previous two expectations is violated. This would be a bug.see the discussion here:
https://stackoverflow.com/a/79146114/10244657
Expected Behavior
Script runs forever.
File
.list
is populated with an exact list of files on each iteration of the loop.Actual Behavior
On WSL's 9P mounts of Windows' disks script stops after some random number of iterations, outputs this number.
File
.list
contains the name of one of the files in the current directory twice.Diagnostic Logs
WslLogs-2024-11-01_06-25-00.zip
The text was updated successfully, but these errors were encountered: