SPLICE_F_NONBLOCK can block on a pipe shared with another process
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c, macos
調査の方向性
Start in src/syscall/io.c and read the io_xfer, io_xfer_once, sys_splice, and splice_drain_chunk paths described in the issue. Compare the input and output pipe races, then investigate macOS pipe APIs for a per-operation nonblocking transfer that preserves data already read. Done means SPLICE_F_NONBLOCK returns without parking the vCPU in both races, without changing nonblocking behavior for other processes sharing the pipe.
索引モデルが issue の本文から書いたものです。
説明
splice with SPLICE_F_NONBLOCK can still block when another process works on the same pipe between a readiness check and the host transfer. There are two windows, both in src/syscall/io.c:
- Input: on a pipe that elfuse does not own (for example inherited stdin),
io_xferanswers a per-call nonblocking read withpoll(0)and then a plainread. When a sibling process drains the pipe between the two calls and the writer stays open, thereadparks the vCPU thread, so the splice hangs instead of returning EAGAIN, and guest signal and teardown checks cannot run. A socket input is not affected, becauseio_xfer_oncealready passesMSG_DONTWAIT. - Output: before each read,
sys_splicechecks the output pipe's free room withpollandfstat, but that reserves nothing. When another writer fills the pipe between the check and the write, the chunk has already been read, andsplice_drain_chunkblocks inio_xferon the output despite the flag.
Linux holds the pipe lock across the check and the transfer. macOS has no per-call nonblocking read or write for a pipe, and setting O_NONBLOCK on the description would change it for every process that shares it. Making the output write nonblocking would close the second window, but it would lose the chunk already taken from a pipe or socket input.
Found in review on #463, where both windows are now stated in the code comments.
- 主要言語
- C
- スター
- 275
- フォーク
- 29
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/elfuse のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 3 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 3 日以内に返信
sysprog21/elfuse の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
HexaCluster/credcheck#86 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mongodb/winkerberos#175 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
AOMediaCodec/SVT-AV1#3320 ·
-
difficulty: easy
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100