`tee` returns `EINVAL` for every pair of pipes
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 40/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c, linux, macos
調査の方向性
Start in sys_tee in src/syscall/io.c, where the early EINVAL return and its comment explain why copying without consuming is refused on macOS. The reproducer in the issue shows the target behaviour: tee should return the byte count, leave the source pipe readable, and copy into the destination. Done means that reproducer prints tee=5 errno=0 with both reads returning 5 bytes. Expect to find a workable approach to peeking a pipe on macOS first, which is the hard part.
索引モデルが issue の本文から書いたものです。
説明
sys_tee (src/syscall/io.c) returns EINVAL without looking at its arguments. Its comment gives the reason: copying without consuming needs a way to look into a pipe, and macOS offers none.
Reproducer:
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
int main(void)
{
int in[2], out[2];
char buf[8];
pipe(in);
pipe(out);
write(in[1], "hello", 5);
errno = 0;
long n = tee(in[0], out[1], 100, SPLICE_F_NONBLOCK);
printf("tee=%ld errno=%d\n", n, errno);
if (n > 0)
printf("copied=%zd still in the source=%zd\n",
read(out[0], buf, sizeof(buf)), read(in[0], buf, sizeof(buf)));
return 0;
}
| result | |
|---|---|
elfuse b57f367 |
tee=-1 errno=22 |
| Linux 6.12 under qemu | tee=5 errno=0, then copied=5 still in the source=5 |
EINVAL is what tee(2) documents for descriptors that are not both pipes, so that is how a guest reads the refusal.
- 主要言語
- C
- スター
- 271
- フォーク
- 28
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 17
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/elfuse のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
sysprog21/elfuse の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
FujiNetWIFI/fujinet-lib#115 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
firmware: transmit() doesn't reset rfTxCurBufIdx, so RFxmit after RFxmitLong can send wrong bytes対応中かも @hermes-crew-337 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
atlas0fd00m/rfcat#182 ·
-
followup
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 4 日以内に返信
-
question
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100