Thank you for your contribution to Slurm. A slight variation of your
patch will be in version 14.11.7 when released in late May. The commit
is here:
https://github.com/SchedMD/slurm/commit/bf81e826a2f7bc752d3239ea724e35ce2867a052
Quoting Jonathon Nelson <[email protected]>:
slurmstepd/task.c does not properly save errno and may overwrite it before
using %m in error messages.
diff --git a/src/slurmd/slurmstepd/task.c b/src/slurmd/slurmstepd/task.c
index 186b6ad..a24d997 100644
--- a/src/slurmd/slurmstepd/task.c
+++ b/src/slurmd/slurmstepd/task.c
@@ -367,6 +367,7 @@ exec_task(stepd_step_rec_t *job, int i)
int fd, j;
stepd_step_task_info_t *task = job->task[i];
char **tmp_env;
+ int saved_errno;
if (i == 0)
_make_tmpdir(job);
@@ -493,6 +494,7 @@ exec_task(stepd_step_rec_t *job, int i)
}
execve(task->argv[0], task->argv, job->env);
+ saved_errno = errno;
/*
* print error message and clean up if execve() returns:
@@ -508,10 +510,12 @@ exec_task(stepd_step_rec_t *job, int i)
eol[0] = '\0';
else
buf[sizeof(buf)-1] = '\0';
+ errno = saved_errno;
error("execve(): bad interpreter(%s): %m", buf+2);
exit(errno);
}
}
+ errno = saved_errno;
error("execve(): %s: %m", task->argv[0]);
exit(errno);
}
--
Jon Nelson
Dyn / Senior Software Engineer
p. +1 (603) 263-8029
--
Morris "Moe" Jette
CTO, SchedMD LLC
Commercial Slurm Development and Support