microsoft / microsoft/vscode-cpptools
debug server startup fails due to stdout buffering
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
Issue Type: Bug
This is probably actually a problem in MIEngine.
I'm using the Arduino extension on macOS, and debugging with avarice and avr-gdb, but this problem also occurs if I configure a plain cppdbg instance in launch.json instead of using the Arduino extension's debugger.
If specifying a debug server to start, it apparently gets launched with pipes, not a pseudo-terminal. If it doesn't flush its stdout, then VS Code will probably never see its startup message, and therefore time out on starting it.
This category of bug seems to have been reported multiple times, usually without resolution, and usually by people working with gdb debug servers.
On macOS, there is a workaround of using /usr/bin/env as debugServerPath, and specifying STDBUF1=L with the rest of the debug server path and arguments.
Arguably, authors of debug servers should line-buffer or explicitly flush their status messages sent to stdout, but this is a subtle interaction that is unlikely to be reported or well-troubleshooted.
Extension version: 1.9.8
VS Code version: Code 1.67.2 (Universal) (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:20:57.384Z)
OS version: Darwin x64 19.6.0
Restricted Mode: No
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz (8 x 3100) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled webgl: enabled webgl2: enabled |
| Load (avg) | 2, 2, 2 |
| Memory (System) | 16.00GB (0.08GB free) |
| Process Argv | --crash-reporter-id 8c334355-bde7-413a-8609-0fd7d4a582f2 |
| Screen Reader | no |
| VM | 22% |
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere den Fehler mit einer cppdbg-Startkonfiguration unter Verwendung von debugServerPath und einem Server, der stdout nicht leert; vergleiche dies mit der /usr/bin/env- und STDBUF1=L-Workaround. Verfolge das Timeout beim Start des Debug-Servers und definiere „done“ als das zuverlässige Erkennen der Startmeldung des Servers, wenn stdout über Pipes verbunden ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- arduino, cpp, macos
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100