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

Offen
#507 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
51/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
c

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
C
Sterne
287
Forks
33
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
18

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus sysprog21/elfuse

Alle Issues in sysprog21/elfuse

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.