WSL icon indicating copy to clipboard operation
WSL copied to clipboard

infinite "virtual" folders when using symlinks (ln -s)

Open dee1337 opened this issue 9 years ago • 6 comments

[UPDATE: this is bugged only on stable build / fixed in the insider build ] Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!

  • A brief description creating symlings via ln -s results in infinite "virtual" folders by using the cd command to navigate. Animated gif of terminal in/out
  • Expected results HOW IT SHOULD BE (REAL UBUNTU:)
dee1337@S3:~$ pwd
	/home/dee1337
	dee1337@S3:~$ ls -l
	lrwxrwxrwx  1 dee1337 dee1337   46 Jan 18 17:15 ex -> /media/dee1337/ACER/Users/Daniel/git/ex03/ex05
	dee1337@S3:~$ cd ex
	dee1337@S3:~/ex$ pwd
	/home/dee1337/ex
	dee1337@S3:~/ex$ cd 1
	bash: cd: 1: No such file or directory
  • Actual results (with terminal output if applicable) WINDOWS 10 UBUNTU BASH:
dee1337@DEE1337:~$ pwd
	/home/dee1337
	dee1337@DEE1337:~$ ls -l
	lrwxrwxrwx 1 dee1337 dee1337  34 Jan 18 16:58 ex -> /mnt/c/Users/Daniel/git/ex03/ex05/
	dee1337@DEE1337:~$ cd ex
        dee1337@DEE1337:~/ex$ cd 1
	dee1337@DEE1337:~/ex/1$ pwd
	/home/dee1337/ex/1
	dee1337@DEE1337:~/ex/1$ cd 2
	dee1337@DEE1337:~/ex/1/2$ pwd
	/home/dee1337/ex/1/2
	dee1337@DEE1337:~/ex/1/2$ cd 3
	dee1337@DEE1337:~/ex/1/2/3$ pwd
	/home/dee1337/ex/1/2/3
	dee1337@DEE1337:~/ex/1/2/3$ cd infinityFolder1337
	dee1337@DEE1337:~/ex/1/2/3/infinityFolder1337$ pwd
	/home/dee1337/ex/1/2/3/infinityFolder1337
	dee1337@DEE1337:~/ex/1/2/3/infinityFolder1337$ cd 1238045345341123109123
	dee1337@DEE1337:~/ex/1/2/3/infinityFolder1337/1238045345341123109123$ pwd
	/home/dee1337/ex/1/2/3/infinityFolder1337/1238045345341123109123
	...
  • Your Windows build number Version 1607 (Build 14393.693)

  • Steps / All commands required to reproduce the error from a brand new installation

  1. create a soft symlink to any existing folder using ln -s 'myRealFolderPath' 'symlinkName'
  2. use cd to navigate to the symlinked folder using the symlink name
  3. use cd in combination with any non existing foldername as often as you want (infinite depth)
  • Strace of the failing command
  • Required packages and commands to install
    See our contributing instructions for assistance.

dee1337 avatar Jan 19 '17 11:01 dee1337

It seems a duplicate of https://github.com/Microsoft/BashOnWindows/issues/1568

onomatopellan avatar Jan 19 '17 13:01 onomatopellan

nope, i can go into the directory with no problem, but: it creates an infinite amount of fake directories. this has nothing to do with trailing slashes.

dee1337 avatar Jan 19 '17 14:01 dee1337

@dee1337 -- could you please post the exact command that you used to create the symlink? This doesn't happen for me; I think a more-precise reproducer would be helpful.

Also, would you be willing to try this on an Insider build? Either natively on your machine or in a VM. A number of symlink bugs have been fixed in Insider builds. You appear to be running the stable version of Windows; we're told that these fixes will go out to stable Windows 10 with its next major release, in April.

aseering avatar Jan 19 '17 14:01 aseering

Can't repro here either. Maybe someone else still on 14393 can try and report back. I don't recall chdir() into a nonexistent directory being reported before. Could have been fixed quietly along the way. Shrug.

therealkenc avatar Jan 19 '17 19:01 therealkenc

@therealkenc but it does sound like #650 and in the OP's post I can see the trailing slash as well (only in his WSL example, though, not in Ubuntu!):

lrwxrwxrwx 1 dee1337 dee1337 34 Jan 18 16:58 ex -> /mnt/c/Users/Daniel/git/ex03/ex05/

CherryDT avatar Jan 19 '17 20:01 CherryDT

downloaded the current win10 preview and tried it within a vm as @aseering suggested. seems, this bug is fixed in the current insider build.

dee1337 avatar Jan 19 '17 21:01 dee1337