SysV shmdt fails with EINVAL in a fork child
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 73/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c, macos
- Ambito
- operating-systems
Direzione di ricerca
Start in src/syscall/sysvipc.c and trace how the attach table is updated during fork and consulted by shmdt. Compare the two approaches mentioned in the #485 review: carrying active attaches in fork state or falling back to the region table. Reproduce the issue with the fork-child shmdt in step 14 of data_child in tests/test-rlimit-mem.c; done means the child detaches successfully and the existing parent detach still succeeds.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A fork child cannot detach a SysV shm attach it inherited. The attach table in src/syscall/sysvipc.c is process-local, and the fork child does not rebuild it, so the child's shmdt finds no entry and fails with EINVAL.
Probe: the parent attaches a 2 MiB segment, forks, and the child calls shmdt on it.
child shmdt |
parent shmdt |
|
|---|---|---|
| Linux 6.12 | 0 | 0 |
elfuse on 170b5df |
-1 EINVAL | 0 |
| elfuse on #485 | -1 EINVAL | 0 |
Since #485 the child shares the attach with the parent (it was a private copy before), and the attach counts toward RLIMIT_AS, so the mapping the child cannot detach stays counted against the child's limit.
Two possible fixes, from the review on #485: carry the active attaches over in the fork state, or fall back to the region table in shmdt. A shmdt in the fork child of step 14 of data_child in tests/test-rlimit-mem.c would cover it.
Refs #485
- Lingua principale
- C
- Stelle
- 287
- Fork
- 33
- Merge medio
- 2g 17h
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sysprog21/elfuse
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di sysprog21/elfuse
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
libreswan/libreswan#3185 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
[SDL3pp] update to 0.12.0Apertacategory:port-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
[InstCombine] 23.x folds 0.0 * (0.0 / x) to 0.0 when x may be zero (fixed on main by #202482)Apertallvm:instcombine
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
llvm/llvm-project#246503 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno