microsoft / microsoft/vscode-cpptools

Debugger pauses unexpectedly and also has SegFaults and unknown signals which only occur during debugging

Aperta
#12,418 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Environment
  • OS and version: Windows
  • VS Code: 1.90.2
  • C/C++ extension: 1.20.5
  • GDB / LLDB version: 14.1
Bug Summary and Steps to Reproduce

Bug Summary:

When running the debugger, random segmentation faults have begun occuring, and the debugger will also stop on lines which do not have any breakpoint. This has only begin happening recently (within the last week), beforehand I was able to run the debugger without any issues.

I have tried rebuilding, reverting to an older version of the extension and of vscode, and switching to an older version of my source code. The same segmentation fault issue has been persistent on all of these.
It is not the same code which causes the segmentation fault either, it seems to occur randomly on any code (including system libraries)

Debugger Configurations
"name": "debug config",
        "type": "cppdbg",
        "request": "launch",
        "program": "app.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\tools\\mingw32\\bin\\gdb.exe",
        "preLaunchTask": "make debug",
        "setupCommands": [
          {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
          },
          {
            "text": "set charset UTF-8"
          },
          {
            "description": "Set Disassembly Flavor to Intel",
            "text": "-gdb-set disassembly-flavor intel",
            "ignoreFailures": true
          }
        ],
Debugger Logs
An example error

1: (4015) ->^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4015) ->(gdb)\r\n"},"seq":1628}
1: (4015) ->(gdb)
--> R (stackTrace-12): {"type":"response","request_seq":12,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"name":"ntdll.dll!ntdll!RtlGetCurrentServiceSessionId","line":0,"column":0,"instructionPointerReference":"0x776f0957","moduleId":1},{"id":1001,"name":"[Unknown/Just-In-Time compiled code]","line":0,"column":0,"instructionPointerReference":"0xd95398a4"},{"id":1002,"name":"ntdll.dll!ntdll!RtlRemovePropertyStore","line":0,"column":0,"instructionPointerReference":"0x77730add","moduleId":1},{"id":1003,"name":"ntdll.dll!ntdll!RtlFreeHeap","line":0,"column":0,"instructionPointerReference":"0x776ef706","moduleId":1},{"id":1004,"name":"ntdll.dll!ntdll!RtlRegisterSecureMemoryCacheCallback","line":0,"column":0,"instructionPointerReference":"0x77786716","moduleId":1},{"id":1005,"name":"ntdll.dll!ntdll!RtlGetCurrentServiceSessionId","line":0,"column":0,"instructionPointerReference":"0x776ef846","moduleId":1},{"id":1006,"name":"[Unknown/Just-In-Time compiled code]","line":0,"column":0,"instructionPointerReference":"0x04242a70"},{"id":1007,"name":"ntdll.dll!ntdll!RtlRemovePropertyStore","line":0,"column":0,"instructionPointerReference":"0x77730add","moduleId":1},{"id":1008,"name":"ntdll.dll!ntdll!RtlFreeHeap","line":0,"column":0,"instructionPointerReference":"0x776ef706","moduleId":1},{"id":1009,"name":"mfedeeprem32.dll!mfedeeprem32!UnitTestInitialise","line":0,"column":0,"instructionPointerReference":"0x652fed1a","moduleId":37},{"id":1010,"name":"mfedeeprem32.dll!mfedeeprem32!UnitTestInitialise","line":0,"column":0,"instructionPointerReference":"0x652fddb5","moduleId":37},{"id":1011,"name":"mfedeeprem32.dll!mfedeeprem32!UnitTestInitialise","line":0,"column":0,"instructionPointerReference":"0x652fbd07","moduleId":37},{"id":1012,"name":"ntdll.dll!ntdll!RtlNumberOfSetBitsUlongPtr","line":0,"column":0,"instructionPointerReference":"0x77731ea6","moduleId":1},{"id":1013,"name":"ntdll.dll!ntdll!LdrShutdownThread","line":0,"column":0,"instructionPointerReference":"0x776e6cda","moduleId":1},{"id":1014,"name":"[Unknown/Just-In-Time compiled code]","line":0,"column":0,"instructionPointerReference":"0x00000001"}],"totalFrames":15},"seq":1630}
<--   C (threads-13): {"command":"threads","type":"request","seq":13}
--> R (threads-13): {"type":"response","request_seq":13,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":" [1]"},{"id":2,"name":" [2]"},{"id":3,"name":" [3]"},{"id":4,"name":" [4]"},{"id":5,"name":"MojoThread [5]"},{"id":6,"name":" [6]"},{"id":7,"name":" [7]"},{"id":8,"name":" [8]"},{"id":9,"name":" [9]"},{"id":17,"name":" [17]"},{"id":18,"name":" [18]"},{"id":19,"name":" [19]"}]},"seq":1633}
Other Extensions

llvm-vs-code-extensions.vscode-clangd
CS128.cs128-clang-tidy

issue persists with these disabled

Additional Information

I am writing a C Webview2 application and building with mingw,

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

Inizia riproducendo il problema segnalato con la configurazione fornita di Windows, VS Code, dell’estensione C/C++, GDB, MinGW e cppdbg. Confronta i log del debugger e gli stack frame quando si mette in pausa inaspettatamente o segnala un segmentation fault, quindi riduci il comportamento a un’applicazione C WebView2 minima e riproducibile. Il lavoro è completato quando la causa è stata identificata e la correzione può essere verificata rispetto ai sintomi segnalati.

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

Valutazione

Stack tecnologico
c, 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
15/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.