SysV shm: write back on munmap and drop attaches at exec

Ouverte
#497 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
c, macos

Piste de recherche

Start by tracing the SysV shared memory attach records and the sys_munmap and exec paths; the issue names shm_retire_unmapped as the lazy cleanup to revisit. Reproduce the described probe: attach, write W, call munmap, then attach again and read the value. Done means writes persist after unmapping and old-image attaches are dropped at exec.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug

Follow-up to #485 (review comment r4504029776).

An attach is released only lazily: the next shmat or shmdt retires records whose serial no region carries. Two cases still differ from Linux:

  • After execve, the new image may never call shmat or shmdt, so every attach of the old image keeps its host attach until the process exits. This also keeps an IPC_RMIDed segment alive.
  • When the guest munmaps an attach without shmdt, its writes are lost. On Linux those pages are the segment, so the writes persist.

Measured with a probe that runs shmat, writes W, calls munmap and attaches again: Linux reads W, and elfuse reads 0.

Proposed fix: write back and detach from the sys_munmap path, and write back and drop every record at exec. This would also make the lazy sweep in shm_retire_unmapped unnecessary.

Langage dominant
C
Étoiles
287
Forks
33
Merge moyen
2 j 17 h
PR mergées (30 j)
18

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de sysprog21/elfuse

Toutes les issues de sysprog21/elfuse

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.