Skip to content

Debugger startup problems

vadimcn edited this page Jan 4, 2021 · 8 revisions

Verbose Logging

Usually, you'll be able to find more details about CodeLLDB errors in its log, which can be found in the VSCode's OUTPUT panel. Be sure to switch view to "LLDB" channel. If this proves unenlightening, try enabling verbose logging by adding "lldb.verboseLogging": true into user/workspace settings.

GLIBC

Symptom: Debugger does not start, /lib64/libc.so.6: version 'GLIBC_2.18' not found message can be seen in the log

This may happen if you are running a Linux distro, which has an glibc older than 2.18. Currently the only workaround seems to be upgrading the glibc library.

Alternatively, you may install LLDB using you distro's package manager, then tell CodeLLDB to use it as a backend as described here. Of course, this LLDB will likely be old and won't have any Rust support.

'A' packet returned an error

Symptom: Debugging fails to start with an error message: process launch failed: 'A' packet returned an error: 8.

This is the catch-all message for LLDB's failure to create the debuggee process. Some common reasons include:

  • The current working directory ("cwd") does not exist or is not accessible by the current user.
  • Debugging inside an unprivileged Docker container with disabled ASLR. While disabling ASLR is generally desirable during debugging (because it may cause non-determinism of program execution), doing so may be disallowed by the default container security profile. Possible solutions:
    • Relax container security profile by starting it with --security-opt seccomp=unconfined option.
    • Turn off ASLR disabling by adding "initCommands": ["set set target.disable-aslr false"] to your launch configuration.

NixOS

Symptom: Debugging fails to start with an error message: Could not start debugging because executable "<USER>/.vscode/extensions/vadimcn.vscode-lldb-1.6.1/adapter/codelldb" was not found.

This happens because in the standard configuration NixOS does not provide Linux dynamic loader at /lib64/ld-linux-x86-64.so.2. This Wiki page talks about this in more detail.
TL;DR: this worked for me:

$ patchelf --set-interpreter $INTERPRETER $HOME/.vscode-server/extensions/vadimcn.vscode-lldb-1.6.1/adapter/codelldb
$ patchelf --set-interpreter $INTERPRETER $HOME/.vscode-server/extensions/vadimcn.vscode-lldb-1.6.1/lldb/bin/lldb
$ patchelf --set-interpreter $INTERPRETER $HOME/.vscode-server/extensions/vadimcn.vscode-lldb-1.6.1/lldb/bin/lldb-server

where INTERPRETER was be found via

$ ls /nix/store/*glibc*/lib64/ld-linux-x86-64.so.2
/nix/store/1yvpgm763b3hvg8q4fzpzmflr5674x4j-glibc-2.32-10/lib64/ld-linux-x86-64.so.2
/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib64/ld-linux-x86-64.so.2

(pick one)

Clone this wiki locally