-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot MPI_File_open a one-character filename, deletes external file anyways #12619
Comments
Thanks Jeff for the report, I will have a look. I am able to reproduce the issue (with GNU compilers fwiw)
|
singleton vs here is a patch ( diff --git a/opal/util/basename.c b/opal/util/basename.c
index 0a57b07078..ad873f2c7c 100644
--- a/opal/util/basename.c
+++ b/opal/util/basename.c
@@ -77,16 +77,18 @@ char *opal_basename(const char *filename)
/* Remove trailing sep's (note that we already know that strlen > 0) */
tmp = strdup(filename);
- for (i = strlen(tmp) - 1; i > 0; --i) {
- if (sep == tmp[i]) {
- tmp[i] = '\0';
- } else {
- break;
+ if (1 < strlen(tmp)) {
+ for (i = strlen(tmp) - 1; i > 0; --i) {
+ if (sep == tmp[i]) {
+ tmp[i] = '\0';
+ } else {
+ break;
+ }
+ }
+ if (0 == i) {
+ tmp[0] = sep;
+ return tmp;
}
- }
- if (0 == i) {
- tmp[0] = sep;
- return tmp;
}
/* Look for the final sep */ |
@ggouaillardet thank you for identifying the issue, can you file a PR with the fix? |
Modify pmix_basename to handle single character filenames. Ported from comment by @ggouaillardet in open-mpi/ompi#12619 Signed-off-by: Ralph Castain <rhc@pmix.org>
Modify pmix_basename to handle single character filenames. Ported from comment by @ggouaillardet in open-mpi/ompi#12619 Signed-off-by: Ralph Castain <rhc@pmix.org>
Modify pmix_basename to handle single character filenames. Ported from comment by @ggouaillardet in open-mpi/ompi#12619 Signed-off-by: Ralph Castain <rhc@pmix.org> (cherry picked from commit 1ab5ece)
Modify pmix_basename to handle single character filenames. Ported from comment by @ggouaillardet in open-mpi/ompi#12619 Signed-off-by: Ralph Castain <rhc@pmix.org> (cherry picked from commit 1ab5ece)
Thanks Jeff Hammond for the bug report Refs. open-mpi#12619 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Sorry for the delay, I just issued #12632 |
Thanks Jeff Hammond for the bug report Refs. open-mpi#12619 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Thanks Jeff Hammond for the bug report Refs. open-mpi#12619 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Thanks Jeff Hammond for the bug report Refs. open-mpi#12619 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp> (cherry picked from commit dd34ecf)
Should be fixed in 5.0.4 scheduled in 7/2024 |
I have a trivial MPI_F08 program that opens, closes and deletes a file. When the filename is "a", this fails. When the filename is "aa", it succeeds. When I create files "a" and "aa" using
touch
, the program still fails, but Open MPI deletes both files, despite saying thatMPI_File_delete
on "a" has failed.Background information
What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
See above.
If you are building/installing from a git clone, please copy-n-paste the output from
git submodule status
.Please describe the system on which you are running
Details of the problem
The text was updated successfully, but these errors were encountered: