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

オープン
#158 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
22/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
72
フォーク
14
平均マージ
15時間 29分
マージ済み PR(30日)
40

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hyperlight-dev/hyperlight-unikraft のほかの issue

hyperlight-dev/hyperlight-unikraft の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。