Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Synchronisation of `wait()` and `kill()`

Aperta
#792 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

The issue names no files, tests or entry points, so first find where the worker threads call kill() and where the OS handler calls wait(). The open question is the synchronization design: the issue asks that the two never run at the same time for the same process identifier, and that a worker which loses the race backs out. Done means the design is agreed, the race is covered by a test, and a worker that loses the race leaves no stray kill().

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

Descrizione

bug
What

My understanding of POSIX is as follows:

When a process has terminated, it stays in the kernel's table as a zombie process until the parent has read its exit status using wait(). As soon as wait() returns, the kernel is free to delete the process and reuse its identifier.

Therefore, if we attempt to call kill() after wait(), there is a chance that we kill some completely unrelated process.

Although process identifiers are usually sequential, making this very unlikely, there is nothing which says they must be allocated that way. And even if they are, the point where the number wraps around can be arbitrarily low.

Acceptance Criteria (DoD)
  • Use of invalid process identifiers is prevented
How

If my understanding is correct, then we must guarantee that these do not happen simultanously:

  • Worker threads calling kill()
  • The OS handler calling wait()

If kill() goes first, it will find the zombie process and return ESRCH. We already handle this case properly.

If wait() goes first, and a worker thread is waiting to kill() the same identifier, the worker thread must back out without doing anything.

Lingua principale
C++
Stelle
6
Fork
35
Merge medio
2g 5h
PR unite (30g)
101

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna 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.

Altre issue di eclipse-score/lifecycle

Tutte le issue di eclipse-score/lifecycle

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.