microsoft / microsoft/vscode-cpptools

debug server startup fails due to stdout buffering

Aperta
#9,388 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

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%

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

Riprodurre il malfunzionamento con una configurazione di avvio cppdbg che utilizzi debugServerPath e un server che non esegua il flush di stdout; confrontarlo con il workaround /usr/bin/env e STDBUF1=L. Tracciare il timeout di avvio del server di debug e definire «done» come il rilevamento affidabile del messaggio di avvio del server quando stdout è connesso tramite pipe.

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

Valutazione

Stack tecnologico
arduino, cpp, macos
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.