Skip to content

Language server exits with code 0 and restarts repeatedly (1.35.4, Windows 11) #14841

Open

Description

Environment

  • OS: Windows 11 Enterprise, 10.0.28000.3231
  • VS Code: 1.141.2
  • C/C++ extension: 1.35.4 (pre-release)
  • Settings: "C_Cpp.maxConcurrentThreads": 2, "C_Cpp.workspaceParsingPriority": "low"

What happens

The notification "The language server crashed. Restarting..." appears again and again. It happened five times in about 34 hours in one VS Code session, from 2026-10-20 to 2026-10-22. Each time the output channel shows the same sequence:

[Error - 8:56:31 PM] Client cpptools: connection to server is erroring.
write EPIPE
[Error - 8:56:31 PM] Server process exited with code 0.
[Error - 8:56:31 PM] Client cpptools: connection to server is erroring.
Cannot call write after a stream was destroyed
[Error - 8:56:32 PM] The language server crashed. Restarting...

The other four were at 9:57 PM, 12:52 AM, 1:28 AM and 5:05 AM. Two of them begin directly with "Server process exited with code 0." and have no write EPIPE line.

The server exits with code 0 rather than a signal, so no crash call stack is shown.

Workspace

  • A large Rust workspace with git submodules: about 4,400 tracked files, of which 7 are C/C++ files (C headers for a C ABI).
  • C/C++ is not edited during these periods.
  • Long cargo builds and test runs with two jobs often run at the same time, so the machine is under load.

Next

I have set "C_Cpp.loggingLevel": "Debug" and will add the debug log from the next occurrence to this issue. Tell me if a different capture would help more, for example a specific logging setting or a dump configuration for an exit with code 0.

— Xmip (https://github.com/IlleNilsson)

Activity

  1. IlleNilsson commented on Oct 22, 2026

    @IlleNilsson
    Author

    Two more crashes today, 2026-10-22 at 3:00 PM and 3:24 PM, on the same versions. This time "C_Cpp.loggingLevel": "Debug" was on, and the debug log points at a likely cause.

    The C/C++ output (debug) during one VS Code session, about 6.5 hours:

    • 183,143 lines;
    • 74,414 cpptools/fileCreated notifications;
    • 1,114 Initiating store rescan...

    Almost all of the notifications are for files that are not C/C++ at all. They are build output written by cargo (Rust) into a build directory inside the workspace folder, which is git-ignored:

    LSP: (invoked) cpptools/fileCreated: file:///d%3A/Repos/Xmip/.ai-interaction/target-windows/debug/deps/xmip_core_runtime.1u8sz4kpuy7lbuibwljd96vi7.1ienmw4.rcgu.o
    Initiating store rescan...
    LSP: (invoked) cpptools/fileCreated: file:///d%3A/Repos/Xmip/.ai-interaction/target-windows/debug/deps/xmip_core_runtime.57jb0a0t0bkbld2t0uz2n3pwe.1ienmw4.rcgu.o
    Initiating store rescan...
    

    Others are copies of the whole repository, made in git-ignored working folders, including .rs, .md, .razor and .d.ts files.

    The crash lines in the output channel match the earlier ones:

    [Error - 3:24:47 PM] Client cpptools: connection to server is erroring.
    write EPIPE
    [Error - 3:24:47 PM] The language server crashed. Restarting...
    [Error - 3:24:53 PM] Server process exited with code 0.
    

    Likely trigger: a burst of thousands of file creations that files.watcherExclude did not cover. Each one is forwarded as cpptools/fileCreated, many of them start a store rescan, and the server then exits. A rescan per created file looks costly when a build writes thousands of object files.

    Possible improvements: ignore fileCreated for extensions cpptools never parses (.o, .rlib, .rs and so on), and coalesce rescans during a burst.

    Workaround applied on our side: the build and working folders have been added to files.watcherExclude, search.exclude and C_Cpp.files.exclude. I'll report whether the crashes stop.

    — Xmip (https://github.com/IlleNilsson)

  2. IlleNilsson commented on Oct 22, 2026

    @IlleNilsson
    Author

    The logs, all from VS Code 1.141.2 and C/C++ 1.35.4 on Windows 11 build 28000: https://gist.github.com/IlleNilsson/60506076f7d42728219b112bd81654f1

    • *-cpptools.log: the output channel at each of the seven crashes (2026-10-20 and 2026-10-22).
    • 20261020T074101-21-CC++.log: the C/C++ output from the first session (default logging).
    • 20261022-debug-tail-4000.log: the last 4,000 lines of the debug output from the second session. The whole of it is 24 MB, 183,143 lines with 74,414 cpptools/fileCreated; I can send it all if useful.

    — Xmip (https://github.com/IlleNilsson)

  3. IlleNilsson commented on Oct 22, 2026

    @IlleNilsson
    Author

    The workspace is open source, so you can reproduce with it: https://github.com/IlleNilsson/Xmip (clone with --recurse-submodules; 43 submodules, mostly Rust, with C headers under module/foundation/abi). A cargo build writes its output under the workspace folder, which is where the fileCreated burst came from. Our workaround is in .vscode/settings.json (files.watcherExclude, C_Cpp.files.exclude); remove those entries to see the crash again.

    — Xmip (https://github.com/IlleNilsson)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions