You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ch4/posix: eager shm slab is leaked on MPI_Abort #8148
The shared memory segment in /dev/shm is only unlinked in the finalize hook, so a process that exits through MPI_Abort() leaves it behind. A test loop here aborted a few hundred times and filled /dev/shm, after which every MPI_Init on the node died with SIGBUS in the slab setup.
MPICH main (5756de5), ch4:ofi, default Hydra, Linux aarch64:
$ cat abort.c
#include <mpi.h>
int main (int argc, char **argv) { MPI_Init (&argc, &argv); MPI_Abort
(MPI_COMM_WORLD, 42); }
$ mpicc -o abort abort.c
$ ls /dev/shm | grep -c mpich_shm
0
$ mpiexec -n 2 ./abort
Abort(42) on node 0 (rank 0 in comm 0): application called
MPI_Abort(MPI_COMM_WORLD, 42) - process 0
Abort(42) on node 1 (rank 1 in comm 0): application called
MPI_Abort(MPI_COMM_WORLD, 42) - process 1
$ ls /dev/shm | grep -c mpich_shm
1
$ for i in $(seq 10); do mpiexec -n 2 ./abort 2>/dev/null; done; ls
/dev/shm | grep -c mpich_shm
11
The same program with MPI_Finalize() in place of MPI_Abort() leaves the count unchanged.
This is a known annoyance. It is difficult to ensure shm files cleanups especially when the process aborts (and killed or segfaults). A easier way out is for some setup (e.g. the job launcher) clean up after the job finishes or run cleanups regularly. Let me know if there is other good ideas.
My thought was, since MPI is still in control before aborting, it could still clean up in this case. But I get how that doesn't completely solve the problem and sites need ways to clean up after other failures anyway (at ours, I think we have "job epilog" site scripts that do this).
My thought was, since MPI is still in control before aborting
That is true. That means we need split the finalize process into two sets: one set assumes graceful condition and another set as panic exit - clean up the best as you exit and never block or create more issue.
LMK if you're open to a patch.
Always. You are encouraged to shoot first then talk after :). No promises.
Activity
hzhou commentedon Nov 12, 2026
This is a known annoyance. It is difficult to ensure shm files cleanups especially when the process aborts (and killed or segfaults). A easier way out is for some setup (e.g. the job launcher) clean up after the job finishes or run cleanups regularly. Let me know if there is other good ideas.
garlick commentedon Nov 12, 2026
My thought was, since MPI is still in control before aborting, it could still clean up in this case. But I get how that doesn't completely solve the problem and sites need ways to clean up after other failures anyway (at ours, I think we have "job epilog" site scripts that do this).
LMK if you're open to a patch. No problem if not.
hzhou commentedon Nov 12, 2026
That is true. That means we need split the finalize process into two sets: one set assumes graceful condition and another set as panic exit - clean up the best as you exit and never block or create more issue.
Always. You are encouraged to shoot first then talk after :). No promises.