-
Notifications
You must be signed in to change notification settings - Fork 936
fix misleading error message with missing #! interpreter #7153
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
fix misleading error message with missing #! interpreter #7153
Conversation
|
Can one of the admins verify this patch? |
|
ok to test |
86940f4 to
5ac46cc
Compare
| getcwd(dir, sizeof(dir)); | ||
| struct stat stats; | ||
| char* msg; | ||
| if(0 == stat(cd->app->app, &stats)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the app is a binary with unresolved dependencies?
I am afraid the error message will be "Bad interpreter" in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree; this would batch too many failure modes (wrong architecture, missing libraries, wrong os, etc.) into one error code, and worse, it would be coming from us, not the OS>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one option could be to stat() the file, and if successful and it starts with #!, then add a hint into the error message that the MPI app is indeed a script and the error could come from the interpreter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Linux, it looks like errno == ENOENT means either the file was missing or it's a bad interpreter. Looks like it's the same behavior on MacOS.
So adding a check for errno == ENOENT would likely be sufficient for this small fix.
This change fixes the misleading error message. I added a conditional to determine whether the error is due to a missing file or a bad interpreter. If it is the latter, a new, more precise error message will be displayed. Fixes open-mpi#4528 Signed-off-by: Maxwell Coil <[email protected]>
5ac46cc to
9b73f6a
Compare
|
I added the |
jsquyres
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggouaillardet @bwbarrett Any other comments on this PR?
This change fixes the misleading error message from mpiexec with missing #! interpreter (#4528). I added a conditional to check whether the file exists, which determines whether to output the default error string (missing file) or a new string (bad interpreter).
Fixes #4528
Signed-off-by: Maxwell Coil [email protected]