SysV shmdt fails with EINVAL in a fork child
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 73/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- c, macos
- Área
- operating-systems
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C
- Estrellas
- 287
- Forks
- 33
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 18
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sysprog21/elfuse
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
Todos los issues de sysprog21/elfuse
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
libreswan/libreswan#3185 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
[SDL3pp] update to 0.12.0Abiertocategory:port-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
[InstCombine] 23.x folds 0.0 * (0.0 / x) to 0.0 when x may be zero (fixed on main by #202482)Abiertollvm:instcombine
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
llvm/llvm-project#246503 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día