Execution timeouts without running in a separate thread
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- cpp, linux
- Área
- operating-systems, performance, security
Línea de trabajo
Start by inspecting the existing virtual-hardware timer approach and the KVM guest execution path; the issue does not name specific files or tests. Investigate whether setitimer/SIGALRM or a signal handler can safely interrupt same-thread execution, and define done through reliable timeout behavior and latency measurements.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Just a thought after reading your excellent paper:
No matter which sandbox solution you chose, you will probably run the sandbox in a separate thread in order to have execution timeouts. Therefore, there will be overhead related to thread communication in most solutions. This latency will usually be approximately the same whether you run TinyKVM, V8 or wasmtime,
This isn't strictly accurate:
-
Wasmtime has a timeout mechanism that makes running on the same thread safe: https://docs.rs/wasmtime/latest/wasmtime/struct.Config.html#method.epoch_interruption
-
While with V8 one could avoid the thread communication overhead by running on the main thread and calling
v8::Isolate::TerminateExecution()with a timer from a watchdog thread. https://v8.github.io/api/head/classv8_1_1Isolate.html#ad212b2e0b66ff5d586cd79cfa0b555fb
So I wonder if TinyKVM implement a similar mechanism and I see you have already explored setting a timer in the virtual hardware here but found it to be slow. https://stackoverflow.com/questions/68590696/timeout-for-kvm-userspace-guest)
As I understand it an interrupt will cause a VMExit which will return control back to the VMM. This suggests installing a no-op signal handler on the thread running the kvm guest will give back control: https://gist.github.com/mcastelino/df7e65ade874f6890f618dc51778d83a
Perhaps this could even just be set with setitimer or SIGALRM so you wouldn't need a watchdog thread.
Of course for most many cases using a thread pool will still be desirable but the lower latency of running in thread like this could be useful for sandboxing routing logic where the thread switching overhead might be noticeable.
- Lenguaje dominante
- C++
- Estrellas
- 828
- Forks
- 23
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 varnish/tinykvm
-
dup2 registers the stale fd instead of the dup() result, leaking a host fd per callPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
[tracking] ARM64: 6 static-audit candidates needing an AArch64 host to confirm or killQuizá libre de nuevo @perbu la tomó hace 94 días y no hay ningún pull request abierto. Abiertohelp wanted
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
-
ELF loader: section/symbol header fields used as offsets without validation against binary.size()Abiertobug
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Todos los issues de varnish/tinykvm
Issues similares
-
bug libcudf
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
level/task module/cloud monitoring type/maintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
LadybirdBrowser/ladybird#13809 ·
Los mantenedores suelen responder en 1 día
-
bug module:nodes tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rocketride-org/rocketride-server#3020 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 9 días