microsoft / microsoft/vscode-cpptools

additionalSOLibSearchPath does not work for remote debugging

Open
#8,344 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Bug type: Debugger

Description
additionalSOLibSearchPath is not respected in debuging session using remote debugger from windows to linux using ssh.

According to maintainer in vscode-remote-release the issue is in debugger, not in the remote extension, see https://github.com/microsoft/vscode-remote-release/issues/5748

Work around
is to use "environment": [{ "name": "LD_LIBRARY_PATH", "value": "/path_to_libImportantLib/" },

Details

  • VSCode Version:
    Version: 1.61.0 (user setup)
    Commit: ee8c7def80afc00dd6e593ef12f37756d8f504ea
    Date: 2021-10-07T18:13:09.652Z
    Electron: 13.5.1
    Chrome: 91.0.4472.164
    Node.js: 14.16.0
    V8: 9.1.269.39-electron.0
    OS: Windows_NT x64 10.0.19042
  • Local OS Version:
    OS: Windows_NT x64 10.0.19042
  • Remote OS Version:
    LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
    Distributor ID: CentOS
    Description: CentOS Linux release 7.7.1908 (Core)
    Release: 7.7.1908
    Codename: Core
    Linux 3.10.0-1160.41.1.el7.x86_64 #1 SMP Tue Aug 31 14:52:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • Remote Extension/Connection Type:
    SSH
  • Logs:

To Reproduce

  1. Compile an executable (exe_to_debug) on remote linux which depends on dynamic libraries in some path, eg /path_to_libImportantLib/ where libraries are found eg. libImportantLib.so
  2. Debug executable on remote linux with dynamic libraries but without setting additionalSOLibSearchPath
    --> gdb fails as expected, output in gdb terminal
    exe_to_debug: error while loading shared libraries: libImportantLib.so: cannot open shared object file: No such file or directory
  3. In Launch.json set
    "additionalSOLibSearchPath": "/path_to_libImportantLib/"
    Expected: Successful debugging
    Current Result: Same error as (2)
    `exe_to_debug: error while loading shared libraries: libImportantLib.so: cannot open shared object file: No such file or directory

Workaround:
Debugging works if I add following to Launch.json:

  "environment": [
    {
      "name": "LD_LIBRARY_PATH",
      "value": "/path_to_libImportantLib/"
    },

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the remote SSH debugging scenario described in launch.json on Windows-to-Linux, comparing additionalSOLibSearchPath with the documented LD_LIBRARY_PATH workaround. Done means the remote executable loads its shared library and debugging succeeds when only additionalSOLibSearchPath is configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.