microsoft / microsoft/vscode-cpptools

High CPU and memory with GDB

Open
#11,005 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Environment
  • OS and version: Windows 11
  • VS Code: 1.78.2
  • C/C++ extension: 1.16.0 & 1.15.4
  • OS and version of remote machine CENTOS 7.9.2009
  • GDB / LLDB version: GNU gdb (GDB) Red Hat Enterprise Linux 10.2-6.el7
Bug Summary and Steps to Reproduce

Bug Summary:
Debug my executable, before it even breaks in main or loads any symbols it spins for minutes at 100% CPU while allocating a ton of memory. Stepping through is very slow also. Using gdb from the command line is very fast, however a suboptimal experience. I have tried it with the system gdb also. I see the same behavior

image
Debugger Configurations
launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/Debug/bin/Debug/dds_worker",
            "args": ["--no-heartbeats"],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}/DDS/dds",
            "environment": [],
            "miDebuggerPath": "/opt/rh/devtoolset-11/root/usr/bin/gdb",
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Enable break on all exceptions",
                    "text": "catch throw",
                    "ignoreFailures": true
                }
        
            ]
        }

    ]
}
Debugger Logs
There's a lot of lines, but most look like
1: (111798) <-1017-symbol-list-lines /home/dev/scratch/connector.cpp
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (111802) 1013: elapsed time 103627\n"},"seq":226}
1: (111802) 1013: elapsed time 103627
Other Extensions

No response

Additional Information

No response

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 with the launch.json configuration and the debugger logs showing repeated symbol-list-lines requests; reproduce the launch and compare VS Code's behavior with command-line GDB. Trace the symbol-loading and stepping path implicated by those requests. Done means debugging no longer spends minutes at 100% CPU or allocates excessive memory before main, and stepping is responsive.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript
Domain
devtools, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.