Skip to content

forge-lsp exits with SIGKILL immediately on LSP server startup #8

Description

@MelbourneDeveloper

Symptom

The VS Code extension fails to connect to forge-lsp immediately after activation with these errors in sequence:

Server process exited with signal SIGKILL.
Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097
Forge client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097

The extension log shows all activation steps complete normally up to client.start, then the process is killed:

[2026-04-27T03:14:44.048Z] step 11: client.start (await)
[2026-04-27T03:14:44.048Z] Server binary: forge-lsp
[Error - 13:14:44] Server process exited with signal SIGKILL.

What is known

  • The forge-lsp binary exists, is arm64, has correct permissions (-rwxr-xr-x), and has no quarantine extended attribute
  • Running forge-lsp --version from the terminal works fine
  • The binary was freshly installed via make install-rust moments before the failure
  • This is not caused by the slnx branch — the connection/startup code path is unchanged from main

Likely causes (to investigate)

  1. macOS memory pressure / jetsam kill: macOS can SIGKILL a process instantly at launch if memory is critically low. The kill happens before any stdout/stderr is produced.
  2. Gatekeeper/notarization: macOS may kill unsigned binaries silently on first run in some security configurations (though no quarantine xattr was observed).
  3. Crash on startup before LSP handshake: forge-lsp may panic or abort in the first milliseconds of startup (e.g., during sidecar discovery or tokio runtime init). The SIGKILL label from VSCode's language client may misreport SIGABRT or exit code 134 as SIGKILL.
  4. Race with the install: the binary was being written by make install-rust at the exact moment VSCode tried to launch it.

Reproduction steps

Not consistently reproducible — appears intermittent. Observed once immediately after make install-rust ran during CI prep.

Expected behaviour

forge-lsp starts, completes LSP initialize handshake, and the extension connects.

Environment

  • macOS Darwin 25.3.0 arm64
  • VS Code with Forge extension
  • forge-lsp built from slnxsupport branch (commit ad95574)

Metadata

Metadata

Assignees

No one assigned

    Labels

    criticalFix these before anything other than a showstopper

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions