microsoft / microsoft/vscode-cpptools

Core dump debugging performance too slow

Aperta
#12,772 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

debugger help wanted
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Environment
  • OS and version: Windows 11
  • VS Code: 1.93.1
  • C/C++ extension: v1.22.6 (pre-release), v1.21.6
  • OS and version of remote machine (if applicable): WSL 2.2.4 - Ubuntu 22
  • GDB / LLDB version: 15.1, 12.1 multiarch, 7.1
Bug Summary and Steps to Reproduce

Bug Summary:

Core dump debugging is quite slow with real world C++ scenarios. Last sample data we received from other devs throws a bad performance and overall experience.

Sample measurements:

  • GDB commnd line takes ~1min-30-45 secs.
  • VScode C++ breakpoint stop ~9 minutes, but I have other samples taking 14 minutes or 20 minutes
  • This is not specific to any laptop. Other colleagues have roughly same numbers.

From what we have seen, the symbol loading is not the main pain point, but the requests done afterwards the symbols have been loaded.

  • The elapsed time for a lot ot threads takes ~17 seconds (and there's total of 64 threads)

Tested in different OS versions, VScode and C++ ext. I don't think it's an issue or regression because this performance problems with debugging production C++ projects has been not new since a few years at least when I started working with vscode.

I also tested with different gdb versions with no effect regarding perf in Vscode core dump debugging:

  • gdb-multiarch v12.1
  • gdb 15.1 (latest release). I built this as I could from source, but I see some error logs in the debug console that could impact...
Debugger Configurations
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "(gdb) Launch Core Dump",
      "type": "cppdbg",
      "request": "launch",
      "program": "/mnt/disk1/asd/app/bin/DispApp",
      "args": ["-g "],
      "stopAtEntry": false,
      "coreDumpPath": "${workspaceFolder}/coreDump",
      "sourceFileMap": {
          "/asdshell": "${workspaceFolder}"
      },
      "additionalSOLibSearchPath": "/mnt/disk1/asd/app/lib;/opt/sdks/whatever-1.1.0/x86/sysroots/x86-what-linux-dev/lib/.debug;/opt/sdks/whatever-1.1.0/x86/sysroots/x86-what-linux/usr/lib",
      "cwd": "${workspaceFolder}",
      "miDebuggerPath": "/usr/bin/gdb-multiarch",
      "MIMode": "gdb",
      "logging": {
        "engineLogging":"verbose",
        "trace": true,
        "traceResponse": true
      },
     "setupCommands": [
      {
        "description": "set sysroot",
        "text": "-gdb-set sysroot ${input:sdkSysPath}/sysroots/x86-what-linux/",
        "ignoreFailures": false
      },
        {
          "text": "-gdb-set auto-load safe-path /",
          "description": "enable safe path",
          "ignoreFailures": false
        }
      ]
    }
  ],
  "inputs": [
    {
      "id": "sdkSysPath",
      "type": "command",
      "command": "shellCommand.execute",
      "args": {
        "command": "ls -d -1 /opt/sdks/*/*",
        "useSingleResult": true
      }
    }
  ]
}
Debugger Logs
Providing logs in .txt because too long for 15.1, 12.1..
Other Extensions

No response

Additional Information

Log file (too huge for pasting)
coredump_issue_debug_vscodelog_15.txt

gdb-multiarch 12.1 (20 minutes!)

gdb_multiarch_12.1_20minutes.txt

gdb15_fresh_wsl(1).txt

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci la sessione di core-dump usando la configurazione di avvio fornita, quindi esamina i log del debugger allegati per individuare le richieste ripetute dopo il caricamento dei simboli. Confronta i tempi nei campioni GDB 7.1, 12.1 e 15.1; il lavoro completato dovrebbe identificare l’operazione limitante e fornire un miglioramento delle prestazioni verificato per i casi multi-thread segnalati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, vscode
Ambito
devtools
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.