Bound the signal transport drain by signal count, not file size

Abierto
#507 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
51/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c

Línea de trabajo

Start in src/syscall/proc.c at drain_signal_transport and read the review discussion linked from #505 for context. Trace how the transport file is read under flock and how drained records are handled after unlocking. Done when standard signals are collapsed to at most one pending record each, while real-time signals and reparent records remain individually handled, without memory use scaling with the transport file size.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Follow-up from #505 (review comment https://github.com/sysprog21/elfuse/pull/505#discussion_r4526279782).

drain_signal_transport in src/syscall/proc.c reads the whole transport file into one malloc(st_size) buffer while holding the file's flock. Another guest process can keep appending records to a stopped process's transport, and each record is one line, so the file and that single allocation can grow without limit. When malloc fails, the drain keeps the records and sets the drain flag again, so every vCPU exit retries the same allocation.

Standard signals (1 to 31) merge while pending, so a drain needs at most one record per standard signal. Real-time signals and reparent ("R") records are different: each one is handled separately. Proposed: while holding the flock, read the file in fixed-size chunks and collapse duplicate standard-signal records into a pending set. Then handle the set and the remaining records after the flock is released, as the drain does today. The memory a drain uses would then grow with the number of real-time and reparent records, not with the file size.

Lenguaje dominante
C
Estrellas
287
Forks
33
Merge medio
2 d 17 h
PR fusionados (30 d)
18

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sysprog21/elfuse

Todos los issues de sysprog21/elfuse

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.