Skip to content
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

hydra/mpiexec: check empty command line and fail early #6520

Merged
merged 1 commit into from
May 15, 2023

Conversation

hzhou
Copy link
Contributor

@hzhou hzhou commented May 13, 2023

Pull Request Description

Check empty command line and fail early rather than resulting in mysterious seg faults.

Fixes #6519

[skip warnings]

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

@hzhou hzhou changed the title hydra: check error for empty command line hydra: check for empty command line and fail early May 13, 2023
@hzhou hzhou changed the title hydra: check for empty command line and fail early hydra/mpiexec: check empty command line and fail early May 13, 2023
@@ -44,6 +44,10 @@ int main(int argc, char **argv)

PMISERV_pg_init();

if (argc == 1) {
HYDU_ERR_SETANDJUMP(status, HYD_INVALID_PARAM, "command line empty. Try -h for usages.\n");
Copy link
Contributor

@raffenet raffenet May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change is good. Just a suggested change to the help text.

Suggested change
HYDU_ERR_SETANDJUMP(status, HYD_INVALID_PARAM, "command line empty. Try -h for usages.\n");
HYDU_ERR_SETANDJUMP(status, HYD_INVALID_PARAM, "No executable provided. Try -h for usage.\n");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied.

Check empty command line and fail early rather than resulting in
mysterious seg faults.
@hzhou hzhou force-pushed the 2305_mpiexec_noarg branch from 548c671 to 73dddde Compare May 15, 2023 15:46
@hzhou hzhou requested a review from raffenet May 15, 2023 15:47
@hzhou hzhou merged commit 3a8737e into pmodels:main May 15, 2023
@hzhou hzhou deleted the 2305_mpiexec_noarg branch May 15, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hydra: mpiexec SIGSEGV
2 participants