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

Fix a bug in the runtime when sbatch is used #26772

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

e-kayrakli
Copy link
Contributor

@e-kayrakli e-kayrakli commented Feb 24, 2025

With CHPL_LAUNCHER_USE_SBATCH, we have to compute some file names. Apparently there's a bug seeped in into that code that showed up as failures in our XC testing. The bug is about using strlen on memory that's zeroed out. This PR stores the string's size in a variable and uses that variable instead of strlening all zeros.

At a high level, this bug shows that it would be good to have our launchers implemented in python as they are basically string manipulations, where C is not... very strong.

Closes https://github.com/Cray/chapel-private/issues/7152

Signed-off-by: Engin Kayraklioglu <e-kayrakli@users.noreply.github.com>
@e-kayrakli e-kayrakli requested a review from riftEmber February 24, 2025 23:59
Copy link
Member

@riftEmber riftEmber left a comment

Choose a reason for hiding this comment

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

Oof, tricky one, my bad

@bradcray
Copy link
Member

Signed-off-by: Engin Kayraklioglu <e-kayrakli@users.noreply.github.com>
Signed-off-by: Engin Kayraklioglu <e-kayrakli@users.noreply.github.com>
@e-kayrakli
Copy link
Contributor Author

@riftEmber -- No worries. It is C's bad, really unmaintainable to do anything with strings in C.

@bradcray -- John suggests checking other launchers, and Anna reported that she did take a look. I grepped a bit, found a couple of launchers where a similar pattern appears, but they all look right to me. I believe that's sufficient to close that issue. I'll add it to the OP so that it auto-closes. Let me know if you disagree.

@e-kayrakli e-kayrakli merged commit 8968af6 into chapel-lang:main Feb 25, 2025
9 checks passed
@e-kayrakli e-kayrakli deleted the slurm-srun-sbatch-fix branch February 25, 2025 18:57
@bradcray
Copy link
Member

Thanks for the quick-fix here, Engin!

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.

3 participants