codelldb icon indicating copy to clipboard operation
codelldb copied to clipboard

Ctrl + C does not send SIGINT with VS Code & CodeLLDB

Open BnMcG opened this issue 1 year ago • 3 comments

OS: Ubuntu 22.04 (VS Code host), MacOS Monterey (VS Code Client) VSCode version: 1.82.2 CodeLLDB version: 1.10.0 Compiler: Rustc 1.72.0 Debuggee: Rust binary built in debug mode with Cargo

When debugging in VS Code, hitting ctrl + C in the integrated terminal detaches the console from the executable's output, but does not propagate SIGINT to the executable being debugged. The VS Code UI still shows that the application is being debugged (has the restart, stop, pause, etc panel open), and the process can still be seen when running ps -aux.

Hitting the stop button on the VS Code UI sends SIGKILL to the application and it exits.

If I manually run the application using cargo run in the VS Code terminal, Ctrl + C does correctly send SIGINT. My terminal uses tmux with a zsh shell configured.

I tried reverting to CodeLLDB 1.92, but this version still exhibits the issue. I didn't try and other previous versions.

LLDB output:

Resolved debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: "Debug executable 'foo'",
  args: [],
  cwd: '${workspaceFolder}/src/foo',
  envFile: '${workspaceFolder}/.env',
  __configurationTarget: 6,
  relativePathBase: '/home/user/bar',
  program: '/home/user/bar/target/debug/foo',
  sourceLanguages: [ 'rust' ],
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
Debug adapter exit code=0 (0x0), signal=null.

BnMcG avatar Oct 08 '23 11:10 BnMcG

I see the same thing both in Ubuntu 22.04 in WSL, and in Raspberry Pi OS. Think I have also seen it in Windows.

I tried a range of CodeLLDB and rust-analyzer versions with the same result.

hungryhorace avatar Apr 26 '24 20:04 hungryhorace

MacOS Sonoma, same weird behavior. Cross-platform bug! =)

acc15 avatar Jul 30 '24 22:07 acc15