Serve gdb on the vCPU thread
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Read the referenced event loop in src/hyperlight_host/src/hypervisor/gdb/event_loop.rs, session setup in src/hyperlight_host/src/hypervisor/gdb/mod.rs, and crash handling in src/hyperlight_host/src/hypervisor/hyperlight_vm/mod.rs. Then inspect the gdb tests and the draft’s stated design: drive GdbStubStateMachine from the vCPU thread and keep the session on HyperlightVm. Done means the listed failure cases are fixed, the Ctrl-C end-to-end case passes, and the open questions about detach and Sandbox::recreate are resolved.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
gdbstub runs on a separate thread and talks to the vCPU thread through two channels. That needs 12 request and 16 reply message kinds, a startup handshake that sends the interrupt handle, and a loop that watches both the channel and the socket.
Problems this causes on main:
- The stop-reason loop spins at 100% CPU while the guest runs. Each pass toggles
O_NONBLOCKand peeks the socket (event_loop.rs#L85). - Ctrl-C while the vCPU is not running, for example during a host call, ends the gdb session.
on_interruptreturns a fatal error (event_loop.rs#L108). - A sandbox from a running snapshot can be dropped before a client connects. Its gdb thread then stays blocked in
accept()and holds the port forever (mod.rs#L305). Later sandboxes on that port only log an error and run without gdb. - An unexpected disconnect leaves debugging enabled and
int3bytes in memory. The next debug exit fails the guest call. The docs say the guest continues (how-to-debug-a-hyperlight-guest.md#L29). - If reporting a crash to gdb fails, the
?returns that debug error instead of the guest's error (hyperlight_vm/mod.rs#L798). - The gdb thread's spawn result and errors are discarded (mod.rs#L301).
Proposal:
- The vCPU thread drives gdbstub's
GdbStubStateMachineat each debug stop. gdbstub'sTargetis implemented onHyperlightVm, so requests call the VM directly. The message enums go away. HyperlightVmowns aGdbSessionwith the listener and the connection. Dropping the sandbox frees the port.- The client is accepted at the first debug stop. A client may connect before the vCPU stops.
- A small watcher thread blocks in
peekon a clone of the socket while the guest runs. On data it callskill_from_debugger. This is the only extra thread. - While stopped, the target holds clones of the
HostSharedMemoryhandles. This avoids lifetimes andunsafe.
Draft result (not yet pushed): about 650 fewer lines. It passes all gdb tests on KVM, plus a new end-to-end Ctrl-C test. It fixes every problem above, #1973, and the rbx read in #1971.
Open questions:
- Attaching again after a detach (see #1210).
- Moving the session to the new VM in
Sandbox::recreate.
- Lenguaje dominante
- Rust
- Estrellas
- 4.8k
- Forks
- 222
- Merge medio
- 1 d 16 h
- PR fusionados (30 d)
- 60
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hyperlight-dev/hyperlight
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
hyperlight-dev/hyperlight#2089 ·
Los mantenedores suelen responder en 1 día
-
S-needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
hyperlight-dev/hyperlight#2073 ·
Los mantenedores suelen responder en 1 día
-
C-bug S-needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
hyperlight-dev/hyperlight#2056 ·
Los mantenedores suelen responder en 1 día
-
A-docs C-bug S-needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
hyperlight-dev/hyperlight#2027 ·
Los mantenedores suelen responder en 1 día
-
S-needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
hyperlight-dev/hyperlight#1970 ·
Los mantenedores suelen responder en 1 día
Todos los issues de hyperlight-dev/hyperlight
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
-
tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
vfarcic/dot-agent-deck#2512 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
pop-os/cosmic-applets#1641 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
pop-os/cosmic-store#650 ·