-
Notifications
You must be signed in to change notification settings - Fork 28.7k
-
Star 163k
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
When I use vscode to open a folder, many empty file with invalid code automatically are generated. #145297
When I use vscode to open a folder, many empty file with invalid code automatically are generated. #145297
Comments
howardlau1999
commented
Mar 17, 2022
•
edited
Loading
edited
Same issue here. Some empty files with random filenames are created when I open the folder using Remote SSH. Some susceptible filenames seem like SQL. Version: 1.65.2 (user setup) Remote OS is CentOS 7 |
daantimmer
commented
Mar 17, 2022
•
edited
Loading
edited
Same issue here. Tried with all extensions disabled, same issue. To make matters worse, some files are even modified to the point where the contents are erased. This happens in all sort of random files. Seems to occur more often when building or configuring using, for example, cmake. But the severity of modified//added files is completely random. I once had a filename that was about 100 characters long and looked like a string dump from a running process as it had a table 'look a like' string of characters. Version: 1.65.2 (user setup) I have this happening on two unrelated machines. |
zhanghb55
commented
Mar 17, 2022
•
edited
Loading
edited
I meet the same situation |
daantimmer
commented
Mar 17, 2022
I have just downgraded (by installing without uninstalling) 1.64.2, the issue persists |
RenoirTan
commented
Mar 17, 2022
Same issue here. I haven't been able to find out what exactly is the trigger but I know it's definitely caused by vs code because when I tried to write stuff using neovim or kate, these files don't appear. From what I can tell, these files only appear in the root of the folder (and not in any subdirectories in the project). The names of these files are not valid unicode (e.g. \312\316\361 which is in octal is 11001010 11001110 11110001 in binary). System Info
Extensions
|
daantimmer
commented
Mar 17, 2022
•
edited
Loading
edited
This statement is incorrect. I get original files being emptied in my build tree and get files named edit: |
howardlau1999
commented
Mar 17, 2022
•
edited
Loading
edited
Seems like if you are using Remote SSH, you can temporarily resolve the issue by deleting |
daantimmer
commented
Mar 17, 2022
For me personally I am not using Remote SSH. |
daantimmer
commented
Mar 17, 2022
•
edited
Loading
edited
Additional information. The deletion of contents of files was not restricted to my working folder! It has even managed to delete contents outside this folder, for example my 'windows kits' has been destroyed and I don't know to what extend, but the following file, for example, is completely empty now:
I do not know if the issue is only affecting parsing of 'include' files or that it could possibly have touched completely unrelated files as well. A few more files were affected: Searched on size 0, modified today |
WoodsCumming
commented
Mar 17, 2022
•
edited
Loading
edited
|
daantimmer
commented
Mar 17, 2022
How would this explain that the issues persisted with all extensions disabled? |
WoodsCumming
commented
Mar 17, 2022
•
edited
Loading
edited
|
kblackcn
commented
Mar 17, 2022
•
edited
Loading
edited
In my case, I disable all extensions and restart vscode. Files are generated just after reenabling cpptools. Maybe there are still running process in the background or so. After I rollback to release branch, the problem just goes away. I'm also suspecting the file-deletion issue ruined my dev docker twice. I found many header files become zero-sized and even pthread won't work. |
bpasero
commented
Mar 17, 2022
I wonder if this issue is being caused by an installed extension. Can you try to run VS Code without extensions? From the command line (NOT the integrated terminal in Code), execute: |
sbovbjerg
commented
Mar 17, 2022
I traced this to 1.9.4 pre-release of the C/C++ extension. |
gev
commented
Mar 17, 2022
node-ipc? |
spartanatreyu
commented
Mar 17, 2022
Man, I can't wait to read the blog post explaining what happened here |
mhavill
commented
Mar 18, 2022
This bug has caused ripples through the PlatformIO community in the last 24 hours. Can anyone tell me how I picked up this pre-release this morning without knowing? I would not be knowing running any pre-release of software (I have enough problems of my own creation! ) - Has it automatically deployed everywhere? |
spartanatreyu
commented
Mar 18, 2022
I recall seeing someone on reddit say they thought it was because they installed the language extension while it was still in pre-release. After some time had passed, the extension officially released, however vscode still had them marked down as pre-release, so it kept installing the new pre-release versions, which eventually led to some of their files becoming corrupted today. |
wangym307
commented
Mar 18, 2022
c/c++ extension v1.9.4 's problem. |
mhavill
commented
Mar 18, 2022
Thank you @sean-mcmanus - believe me - I am absolutely delighted that you have found this - The alternative would point (in my mind) to some security attack/breach. I don't know if anything provided helped, but I would be more than happy to be involved in forensics on these matters. Have a great day (if there is any left!) |
sean-mcmanus
commented
Mar 18, 2022
Yeah, there was no security attack or breach -- just an accidental usage of uninitialized memory from a modification to an external third party subsystem that doesn't follow modern C++ coding guideline that could have prevented or detected usage of uninitialized pointers (like our main code base does). |
daantimmer
commented
Mar 18, 2022
Oof, that sounds like a deep deep deeeeeep rabbit hole to find. Good on finding though! |
daantimmer
commented
Mar 18, 2022
That was me. I've had my installation for the past 4 years :-). Even the 'insiders' configuration in my settings file was still there from a long long time ago. For me the insiders setting carried over, I guess, to the pre-release version of the 'new new way' that extensions were updated. But then again, this issue could easily, as it sounds, have slipped in a proper released version. So, sometimes shit just hits the fan. |
sean-mcmanus
commented
Mar 18, 2022
@daantimmer I don't believe this bug would've made it into the non-pre-release builds, because we have a policy of shipping changes to the pre-release version first and then releasing into the non-pre-release after things seem okay after a few days...with "last minute" changes generally only occurring if we believe it's a low risk fix. |
daantimmer
commented
Mar 18, 2022
I was not trying to imply that this specific bug could have slipped through. Was trying to imply that nobody is ever perfect and mistakes can happen. Even on a thoroughly tested release. "Looking at you, any random game development studio" :-) |
TavakoliAli
commented
Mar 18, 2022
•
edited
Loading
edited
Hello |
sean-mcmanus
commented
Mar 18, 2022
@TavakoliAli Unfortunately, there is no way to restore the file (as far as I know). You should consider using a source control system such as git, cloud storage backup, etc.. Using the non-pre-release version of the C/C++ extension (1.8.4) would also be recommended. File deletion/corruption bugs are pretty rare. That last one we had was a couple years ago during code formatting in a multi-root workspace ( microsoft/vscode-cpptools#1073). In fact, we still have a bug where formatting on a symlinked workspace folder can corrupt files ( microsoft/vscode-cpptools#5061), which has a root cause of microsoft/vscode-cpptools#4573. |
mhavill
commented
Mar 18, 2022
@sean-mcmanus , @hello-smile6 - thank you |
mhavill
commented
Mar 18, 2022
This is the first post that mentions deletion of source files? Are there other examples?
|
daantimmer
commented
Mar 18, 2022
•
edited
Loading
edited
I've had source and header file contents deleted. Both in source control, but also in my windows SDK installation. I've mentioned this here and there as well :-) |
hello-smile6
commented
Mar 19, 2022
Should be in |
mhavill
commented
Mar 19, 2022
Sounds like Linux? not Windows 10? |
hello-smile6
commented
Mar 19, 2022
Then try |
mhavill
commented
Mar 19, 2022
Ah - if only Windows and Windows developers were so consistent! No such logs and I cannot find anything in Google searches. Perhaps @sean-mcmanus can let us know if there is such for logging installations/updates in VSC? |
hello-smile6
commented
Mar 19, 2022
Maybe use a VM and wine? |
sean-mcmanus
commented
Mar 19, 2022
@mhavill I'm not familiar with any logging in regards to installation of extensions (someone on the VS Code team might know). I know that prior to VS Code's pre-release feature we had our own custom C_Cpp.updateChannel "Insiders" setting, so if you had that setting set somehow, then you got auto-migrated to the VS Code's new pre-release mechanism and we had a dialog box that appeared that prompted users to switch to the Insiders build, so you may have clicked that. |
mhavill
commented
Mar 19, 2022
Thanks @sean-mcmanus. Maybe someone will pick it up in the future!?
I am most definitely an outsider not an insider :) It'll be a mystery. |
TavakoliAli
commented
Mar 19, 2022
So i have all problems you mentioned. I rewrote header and deleted null files but i don't have enough time to rewrite source file. |
hello-smile6
commented
Mar 19, 2022
Could it be a disk issue? Maybe check the |
sean-mcmanus
commented
Mar 21, 2022
The issue was a temp file string pointer that in some cases ended up pointing to memory that was deleted/invalid, so if that location in memory happened to be filled with a string for an existing file (that was writable), then that file could have been emptied. In most cases, the memory was filled with "garbage" data. |
hello-smile6
commented
Mar 21, 2022
Wow, that sounds problematic! |
mean-ui-thread
commented
Mar 23, 2022
FINALLY! I thought my hard drive was failing. This issue is exactly what I exprenced last week! I've lost half a day of uncommited code being worked on because of this bug. Many headers from my cross compiler got wiped out to 0 byte. I never consented to get pre-release of my exentions, but my |
rangsimanketkaew
commented
Mar 29, 2022
Issue confirmed! It still keeps generating me a number of alien (invalid encoding) files. |
sean-mcmanus
commented
Mar 29, 2022
•
edited
Loading
edited
@rangsimanketkaew We shipped an update with a fix 12 days ago. What version (of the C/C++ extension) are you using? You should probably be using 1.9.7 (or 1.9.6, which is identical, but 1.9.5 a fix too). We haven't received any reports yet of invalid or erased files with those versions. If you repro the issue without the C/C++ enabled, then it's a different issue. |
5wattbulb
commented
Apr 6, 2022
I opened issue #145676 mentioned above. I am using C/C++ extension version 1.9.7 and I can't report any new rogue files being created but has anyone found a way of deleting the ones created earlier? I posted the below in #145676.
|
hello-smile6
commented
Apr 23, 2022
What if you delete them by inode number? |
5wattbulb
commented
Apr 24, 2022
WOW. I had to look that up and then delete each one individually but it worked. I feel cleansed now. Thanks hello-smile6. |
Does this issue occur when all extensions are disabled?: Yes/No
Sorry for I had deleted the VS Code, because I worry if the computer is attacked by virus. But VS Code is recent version. I update VS Code yesterday.
Steps to Reproduce:
When I use vscode to open a folder, many empty file with invalid code automatically are generated.
And I use OpenFOAM(a software) to wmake(make) some function, the contents in some ".H" and ".C" which are related with this function is disappeared, these files become empty, though these files ".H" and ".C" are still exist.
The text was updated successfully, but these errors were encountered: