VSCode C++ Extension 1.9.4 Causes Random Empty Files and File Corruption

A recent bug in the VSCode C++ extension version 1.9.4 randomly creates empty files with invalid code, corrupts existing user and system files, and appears to stem from uninitialized memory usage, but can be avoided by downgrading or disabling the problematic extension.

IT Services Circle
IT Services Circle
IT Services Circle
VSCode C++ Extension 1.9.4 Causes Random Empty Files and File Corruption

Recently, a user named na-an reported that when opening a folder with Microsoft VSCode, the editor automatically generates many empty files containing invalid code. The issue was posted on the VSCode GitHub repository (https://github.com/microsoft/vscode/issues/145297) and sparked widespread discussion among users experiencing the same problem.

Some of the generated files have very short names, while others have long names; their filenames are not valid Unicode, such as the octal representation \312\316\361 shown in the image. These randomly created files seem to originate from a memory dump of a running process, containing strings typically found in executable files, suggesting stack corruption or out‑of‑bounds pointer issues.

The bug not only creates empty files but also randomly modifies user files. For example, all header files of user daantimmer were cleared to 0 KB, causing data loss for those without backups.

The impact of the bug extends beyond the current workspace; it can even erase certain system files and directories, as illustrated in the subsequent screenshots.

The issue occurs on both Windows and Linux systems, and all affected users share a common factor: they write C++ code and use the VSCode C++ extension. Disabling all extensions or switching the C++ extension to a stable version (1.8.4) resolves the problem.

Investigation revealed that the root cause is the pre‑release version 1.9.4 of the VSCode C++ extension, which is unstable and introduces the file‑system bug. Users who have automatic updates enabled may be upgraded to this problematic version without notice.

The extension developers are unaware of the exact source of the issue in version 1.9.4. The memory corruption appears to be related to earlier unresolved bugs (#4573 and #5061) in the C++ extension, likely caused by the use of uninitialized memory and interaction with third‑party subsystems that violate modern C++ coding guidelines.

To resolve the issue, users should avoid installing version 1.9.4 of the C++ extension; versions 1.9.5, 1.9.3, 1.8.4, or the latest 1.9.6 do not exhibit the problem.

bugVSCodedevelopment toolsC++ extensionFile Corruption
IT Services Circle
Written by

IT Services Circle

Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.