Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

pwritev2 RWF_APPEND can overwrite a concurrent append

Aperta
#471 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, macos

Direzione di ricerca

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.

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

Descrizione

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.

Lingua principale
C
Stelle
275
Fork
29
Merge medio
2g 22h
PR unite (30g)
18

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 sysprog21/elfuse

Tutte le issue di sysprog21/elfuse

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.