Skip to content

Unable to Start Debugging in WSL CentOS 7.9 Environment #13363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Dongbox opened this issue Mar 11, 2025 · 3 comments
Open

Unable to Start Debugging in WSL CentOS 7.9 Environment #13363

Dongbox opened this issue Mar 11, 2025 · 3 comments
Labels
bug debugger help wanted Can be fixed in the public (open source) repo.

Comments

@Dongbox
Copy link

Dongbox commented Mar 11, 2025

Environment

  • OS: Windows11 with WSL (2.4.11.0)
  • WSL Distribution: CentOS 7.9
  • VS Code Version: 1.98.1
  • C/C++ Extension Version (cpptools): 1.22.11
  • GDB version: 7.6.1

Bug Summary and Steps to Reproduce

Bug Summary:

I am unable to successfully start debugging by pressing F5 in my current setup. The debugging session does not initiate, and I am unsure how to diagnose the issue.

Steps to reproduce:

Environment Setup

I installed CentOS 7.9 as a WSL2 subsystem by downloading and extracting the archive from the following link:
https://github.com/mishamosher/CentOS-WSL/releases/tag/7.9-2211.

After ensuring that WSL2 (with Hyper-V) was enabled, I right-clicked the installer and ran it as an administrator to complete the CentOS 7 installation.

0. Creating a Non-Administrator User

I created a user named dongbox (me) using the following command:

useradd -m -G wheel -s /bin/bash dongbox && echo "dongbox:dongbox" | chpasswd

1. Switching to Aliyun Mirror for Faster Package Downloads

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all && yum makecache

2. Installing GCC, G++, and GDB via YUM

sudo yum install -y gcc gcc-c++ gdb

3. Installing CMake 3.28

wget https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0-linux-x86_64.tar.gz
tar -xvzf cmake-3.28.0-linux-x86_64.tar.gz
mv cmake-3.28.0-linux-x86_64 /opt/cmake-3.28.0
ln -s /opt/cmake-3.28.0/bin/cmake /usr/local/bin/cmake

Issue: Debugging Failure in VSCode

After setting up the environment, I connected to CentOS 7.9 via VSCode Remote - WSL and attempted to compile and debug my program. However, debugging failed, its waitting forever.

Debugger Configurations

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        
        {
            "name": "(GF_CTJ) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/GF_CTJ/program/model/demo/APS_PROJECT_DEMO",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ],
            "logging": { "engineLogging": true, "trace": true, "traceResponse": true }
        }
        

    ]
}

Debugger Logs

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1754) LaunchOptions{\"name\":\"(GF_CTJ) Launch\",\"type\":\"cppdbg\",\"request\":\"launch\",\"program\":\"/home/dongbox/work/aps-projects/GF_CTJ/program/model/demo/APS_PROJECT_DEMO\",\"args\":[],\"stopAtEntry\":false,\"cwd\":\"/home/dongbox/work/aps-projects\",\"environment\":[],\"externalConsole\":true,\"MIMode\":\"gdb\",\"setupCommands\":[{\"description\":\"Enable pretty-printing for gdb\",\"text\":\"-enable-pretty-printing\",\"ignoreFailures\":true},{\"description\":\"Set Disassembly Flavor to Intel\",\"text\":\"-gdb-set disassembly-flavor intel\",\"ignoreFailures\":true}],\"logging\":{\"engineLogging\":true,\"trace\":true,\"traceResponse\":true},\"__configurationTarget\":6,\"__sessionId\":\"47b4f490-406a-4b3c-bf3b-237cb4e1371e\"}\n"},"seq":2}
1: (1754) LaunchOptions{"name":"(GF_CTJ) Launch","type":"cppdbg","request":"launch","program":"/home/dongbox/work/aps-projects/GF_CTJ/program/model/demo/APS_PROJECT_DEMO","args":[],"stopAtEntry":false,"cwd":"/home/dongbox/work/aps-projects","environment":[],"externalConsole":true,"MIMode":"gdb","setupCommands":[{"description":"Enable pretty-printing for gdb","text":"-enable-pretty-printing","ignoreFailures":true},{"description":"Set Disassembly Flavor to Intel","text":"-gdb-set disassembly-flavor intel","ignoreFailures":true}],"logging":{"engineLogging":true,"trace":true,"traceResponse":true},"__configurationTarget":6,"__sessionId":"47b4f490-406a-4b3c-bf3b-237cb4e1371e"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1800) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-ywajxroh.xrf ; cd \"/home/dongbox/work/aps-projects/GF_CTJ/program/model/demo\" ; DbgTerm=`tty` ; set -o monitor ; trap 'rm \"/tmp/Microsoft-MIEngine-In-ujrknyku.gp4\" \"/tmp/Microsoft-MIEngine-Out-4khefns3.q5x\" \"/tmp/Microsoft-MIEngine-Pid-ywajxroh.xrf\" \"/tmp/Microsoft-MIEngine-Cmd-uyhouolm.c52\"' EXIT ; \"/usr/bin/gdb\" --interpreter=mi --tty=$DbgTerm < \"/tmp/Microsoft-MIEngine-In-ujrknyku.gp4\" > \"/tmp/Microsoft-MIEngine-Out-4khefns3.q5x\" & clear; pid=$! ; echo $pid > \"/tmp/Microsoft-MIEngine-Pid-ywajxroh.xrf\" ; wait $pid; \n"},"seq":4}
1: (1800) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-ywajxroh.xrf ; cd "/home/dongbox/work/aps-projects/GF_CTJ/program/model/demo" ; DbgTerm=`tty` ; set -o monitor ; trap 'rm "/tmp/Microsoft-MIEngine-In-ujrknyku.gp4" "/tmp/Microsoft-MIEngine-Out-4khefns3.q5x" "/tmp/Microsoft-MIEngine-Pid-ywajxroh.xrf" "/tmp/Microsoft-MIEngine-Cmd-uyhouolm.c52"' EXIT ; "/usr/bin/gdb" --interpreter=mi --tty=$DbgTerm < "/tmp/Microsoft-MIEngine-In-ujrknyku.gp4" > "/tmp/Microsoft-MIEngine-Out-4khefns3.q5x" & clear; pid=$! ; echo $pid > "/tmp/Microsoft-MIEngine-Pid-ywajxroh.xrf" ; wait $pid; 
--> C (runInTerminal-6): {"type":"request","command":"runInTerminal","arguments":{"kind":"external","title":"cppdbg: APS_PROJECT_DEMO","cwd":"","args":["/bin/sh","/tmp/Microsoft-MIEngine-Cmd-uyhouolm.c52"],"env":{}},"seq":6}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1811) Wait for connection completion.\n"},"seq":8}
1: (1811) Wait for connection completion.

Other Extensions

Extensions installed on WSL: CentOS7:

donjayamanne.githistory
esbenp.prettier-vscode
github.copilot
github.copilot-chat
mhutchie.git-graph
ms-python.black-formatter
ms-python.debugpy
ms-python.isort
ms-python.python
ms-python.vscode-pylance
ms-toolsai.datawrangler
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-toolsai.vscode-jupyter-cell-tags
ms-toolsai.vscode-jupyter-slideshow
ms-vscode.cmake-tools
ms-vscode.cpptools
twxs.cmake
yy0931.vscode-sqlite3-editor

Additional Information

When I run OpenDebugAD7 manually, I get the following output:

$ ~/.vscode-server/extensions/ms-vscode.cpptools-1.22.11/debugAdapters/bin/OpenDebugAD7 
waiting for v8 protocol on stdin/stdout
@sean-mcmanus
Copy link
Contributor

@Dongbox This seems like a duplicate of #13219

@Dongbox
Copy link
Author

Dongbox commented Mar 18, 2025

@Dongbox This seems like a duplicate of #13219

Actually, I have checked this issue you mentioned and followed the instructions to use the older version 1.22.11. After directly calling OpenDebugAD7, the error about the missing GLIBCXX library no longer appears, but the problem is that it keeps waiting indefinitely as you can see in my logs.

Copy link

Thank you for reporting this issue. We’ll let you know if we need more information to investigate it. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated.

@github-actions github-actions bot added the help wanted Can be fixed in the public (open source) repo. label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug debugger help wanted Can be fixed in the public (open source) repo.
Projects
None yet
Development

No branches or pull requests

2 participants