Long file paths causing segfault

1 view
Skip to first unread message

Cooper Burns

unread,
Dec 10, 2025, 3:36:57 PM (13 days ago) Dec 10
to Open MPI Users
Hello all -
 
I am running into an issue with OpenMPI 5.0.6, 5.0.9 (latest) that looks like a bug in the MPI_File_open API.

If I try to open a file where the provided filename is very long (on my system it looks like anything above 262ish characters has the issue) the MPI_File_open call just segfaults immediately.

A small reproducer code is here: 
#include <mpi.h>
#include <stdio.h>
#include <string>


int main (int argc, char** argv)
{

   MPI_Init(&argc, &argv);
   MPI_File shortfile;
   MPI_File longfile;
   std::string long_filename = "longfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilename";
   std::string short_filename = "testfile.txt";
   printf("OPENING SHORT FILE\n");
   int fopen_short_error = MPI_File_open(MPI_COMM_WORLD, short_filename.c_str(), MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &shortfile);
   printf("SHORT FILE OPENED\n");
   MPI_File_close(&shortfile);
   
   printf("OPENING LONG FILE\n");
   int fopen_long_error = MPI_File_open(MPI_COMM_WORLD, long_filename.c_str(), MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &longfile);
   printf("LONG FILE OPENED\n");
   MPI_File_close(&longfile);
 
   MPI_Finalize();
}

The output of this program is:

OPENING SHORT FILE
SHORT FILE OPENED
OPENING LONG FILE
[localhost:155795] *** Process received signal ***
[localhost:155795] Signal: Segmentation fault (11)
[localhost:155795] Signal code:  (128)
[localhost:155795] Failing at address: (nil)
Segmentation fault (core dumped)

Has anyone seen this error before? As far as I can tell this is not an issue with OpenMPI versions 4.x.x, and it is not a problem on MPICH, IntelMPI, or HPCX (which is based on OpenMPI 4.x.x). I have not tried any other MPI implementations.

Thanks,
Cooper

--
Cooper Burns
Team Lead - HPC
Phone(608) 230-1551
Web | Linkedin | Facebook | YouTube
--
Join us at the 2025 CONVERGE CFD Conference–Global!

Edgar Gabriel

unread,
Dec 10, 2025, 5:04:26 PM (13 days ago) Dec 10
to us...@lists.open-mpi.org

Thank you for the bug report. Could you please create an issue on here: https://github.com/open-mpi/ompi/issues ?

 

I will take a look, but its easier to keep track if there is an issue associated with the request.

Best regards
Edgar

To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@lists.open-mpi.org.

Reply all
Reply to author
Forward
0 new messages