kernel: epoll waits ignore signals, and alarm() is a stub

Aperta
#158 0 commenti 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
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c

Direzione di ricerca

Start with lib/posix-process/signal/alarm.c, where alarm() is a UK_WARN_STUBBED stub, and with pprocess_signal_interrupt(), which already interrupts blocked threads for fatal signals. Then look at the poll, ppoll, select, pselect6 and epoll_wait paths, and the uk/process.h comment for uk_sys_pause(). Done means poll(NULL, 0, 5000) returns EINTR on SIGINT, alarm() delivers SIGALRM, and SA_RESTART is respected for read() and accept(). The scope spans several subsystems and needs design decisions, so discuss the approach with maintainers before starting.

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

Descrizione

bug

Two gaps found while fixing pause() on arm64 (#156), each reproduced on stock QEMU/KVM:

  • Epoll waits are not interrupted by signals. poll(), ppoll(), select(), pselect6() and epoll_wait() with fds, or with a timeout, sleep through a signal the thread takes, where Linux returns EINTR: poll(NULL, 0, 5000) sleeps the full 5 s through a SIGINT. #156 only covers the calls that watch no fd and have no timeout (they become pause() or sigsuspend()). A general fix interrupts blocked threads for any signal they take, as pprocess_signal_interrupt() does for fatal ones, and needs SA_RESTART handling for read(), accept() and the like.
  • alarm() is a stub (lib/posix-process/signal/alarm.c, UK_WARN_STUBBED): it never delivers SIGALRM, so a program bounding a wait with alarm() waits for good.

Also to fix with the first: the uk/process.h comment for uk_sys_pause()/uk_sys_rt_sigsuspend() should say that -ENOTSUP and -EINVAL apply with CONFIG_LIBPOSIX_PROCESS_SIGNAL only. In the message of c1051427, "Epoll waits with fds, or with a timeout, are still not interrupted by a signal, as they are on Linux" means unlike on Linux, where they return EINTR.

Lingua principale
Rust
Stelle
72
Fork
14
Merge medio
15h 29m
PR unite (30g)
40

Preparare l'ambiente

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 hyperlight-dev/hyperlight-unikraft

Tutte le issue di hyperlight-dev/hyperlight-unikraft

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.