Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

pwritev2 RWF_APPEND can overwrite a concurrent append

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

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

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

評価

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

調査の方向性

Start in src/syscall/io.c at sys_pwritev_append, then compare the O_APPEND paths in sys_pwrite64 and sys_pwritev. The issue describes a race but no safe approach for descriptors without O_APPEND; investigate available host mechanisms while accounting for shared file-description flags. Done means concurrent RWF_APPEND writes do not overwrite one another, including on descriptors opened without O_APPEND.

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

説明

bug

pwritev2 with RWF_APPEND (sys_pwritev_append in src/syscall/io.c) reads the end of file with fstat and then writes there with pwritev, in two host calls. Linux finds the end of file and writes under the inode lock, so two processes appending to one file with RWF_APPEND never overwrite each other. Under elfuse both can read the same st_size, and the second write lands on the first one's bytes while each call returns success.

For a descriptor that is already O_APPEND, sys_pwrite64 and sys_pwritev now route the write through the host's own append (#463), and RWF_APPEND on such a descriptor could share that path. For a descriptor opened without O_APPEND, macOS has no call that appends atomically without changing the open file description's flags. Setting O_APPEND with F_SETFL around the write would change the flags that a forked child and sibling threads share.

Found in review on #463. It is not changed there because the same fstat then pwritev shape exists on main.

主要言語
C
スター
275
フォーク
29
平均マージ
2日 22時間
マージ済み PR(30日)
18

環境構築

はじめの一歩

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

sysprog21/elfuse のほかの issue

sysprog21/elfuse の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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