Skip to content

Fix job env loop hang and memory handling in spank_qrmi - #203

Merged
ohtanim merged 1 commit into
mainfrom
aw/fix-job-env-loop
Sep 29, 2026
Merged

ohtanim merged 1 commit into
mainfrom
aw/fix-job-env-loop

Conversation

@awennersteen

@awennersteen awennersteen commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description of Change

  • A job environment entry that starts with {resource}_QRMI_ but has no = skipped the index++, so slurmstepd looped forever. The loop is now a for.
  • The acquisition token is allocated with strdup() but was freed with qrmi_string_free() (Rust CString::from_raw); it is now freed with free().
  • Free the QRMI config (including on early returns) and the loaded job info.
  • Use %zu/%td for size_t/ptrdiff_t, and log why the job fails when its time limit cannot be read.

Testing

  • Builds with -Wall -Wextra against libslurm 23.11 (Ubuntu 24.04).
  • Standalone harness for the env loop (entry without = is skipped, loop terminates).

A job environment entry that starts with {resource}_QRMI_ but has no
'=' skipped the index increment, so slurmstepd looped forever.

Also free the strdup'd acquisition token with free() instead of
qrmi_string_free(), free the QRMI config and the loaded job info,
use %zu/%td for size_t/ptrdiff_t, and log why the job fails when its
time limit cannot be read.
@awennersteen
awennersteen marked this pull request as ready for review September 29, 2026 10:39

@ohtanim ohtanim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@ohtanim
ohtanim merged commit f3b5428 into main Sep 29, 2026
2 checks passed
@ohtanim
ohtanim deleted the aw/fix-job-env-loop branch September 29, 2026 10:49
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.

2 participants