-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Formatting with a symlinked folder may randomly corrupt files #5061
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
Comments
@olzhas Can you provide more info? What OS are you on? Does it repro with a single root workspace folder or does it require multiple root folders? Do you know of a way to make the "once in a while" more consistent? The root cause might be related to other known symlink issues, such as #4573 or #3123 . |
When I have the same file open through two different symlinks (cpp tools go to definition finds it differently than when I open it from the file explorer on the side), and I try to format one of the files, it gets corrupted. Closing one of the copies fixes the problem I'm on macOS 10.14.6, VSCode 1.44.2. |
I've noticed I'm seeing this issue. On Windows 10, VSCode 1.44.2, cpptools 0.27.1, using WSL and a symlinked directory. I haven't sorted out how to recreate the problem reliably. I see it on some tabs, not others. On the tab I was seeing this reliably, closed the file and reopened in a new tab, no longer seeing the corruption. The file was only open in a single tab. |
@rfjakob The bug hasn't gotten many upvotes and only seems to happen when symlinked folders are used. I'm not sure if we have a repro yet too. |
Counting through the duplicates, there's independent reports from
I guess compared to the total user base of VS Code, that's few, but the impact is quite high (data loss). If this were my project, I would disable code formatting per default until a reproducer is found. |
Ok, I found a reproducer: (1) Prepare source code repo & symlink
(2) In VS Code: File -> New Window. Add Folder: /tmp/issue5061/earlyoom-symlink (3) In the sidebar, open (4) In (5) You now have (6) Write "foo" to the bottom of the 2nd (7) Jump back to 1st (8) Click save again for more garbage (each save appends more) |
what i can do when my complier my program in c and got error like The terminal process failed to launch (exit code: -1). |
How can intellisense cause corruption in files? Does it write to source code files? |
I am affected by the bug. My working directory is a symlink, and once in a while when I reformat the code my file becomes corrupted. I am using /0.27.0-insiders2
Originally posted by @olzhas in #1073 (comment)
The text was updated successfully, but these errors were encountered: