Skip to content

Debugger startup problems

vadimcn edited this page Jan 14, 2021 · 8 revisions

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 "/.../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 $VSCODE/extensions/vadimcn.vscode-lldb-1.6.1/adapter/codelldb
$ patchelf --set-interpreter $INTERPRETER $VSCODE/extensions/vadimcn.vscode-lldb-1.6.1/lldb/bin/lldb
$ patchelf --set-interpreter $INTERPRETER $VSCODE/extensions/vadimcn.vscode-lldb-1.6.1/lldb/bin/lldb-server

where VSCODE is the location of VSCode data directory (e.g. /home/user/.vscode or /home/user/.vscode-server - if using remoting),
and INTERPRETER is the path of ELF interpreter (which can be found via e.g. ls /nix/store/*glibc*/lib64/ld-linux-x86-64.so.2).

Clone this wiki locally