A SPANK plugin that gets `S_JOB_ARGV` will have the first entry overwritten by the value for the environment variable `SLURM_BCAST` if set in the environment. I have also reproduced this same issue on Slurm 22.05.5. We use a SPANK plugin for one of our products, ATP. It relies on this functionality to get the path to the target binary. ``` $ srun ls ~ srun: argv[0]: ls srun: argv[1]: /home/users/adangelo $ SLURM_BCAST=/tmp/ srun ls ~ srun: argv[0]: /tmp/ srun: argv[1]: /home/users/adangelo ``` Plugin source: ``` #include <stdlib.h> #include <stdio.h> #include <slurm/spank.h> #define MAJOR_VER 1 #define MINOR_VER 0 #define FULL_VERSION ((MAJOR_VER * 1000) + MINOR_VER) SPANK_PLUGIN(launch/repro, FULL_VERSION) int slurm_spank_local_user_init(spank_t sHandle, int argc, char **argv) { int binary_argc = 0; char const** binary_argv = NULL; if (spank_get_item(sHandle, S_JOB_ARGV, &binary_argc, &binary_argv)) { slurm_info("Failed to get binary argv\n"); return 0; } for (int i = 0; i < binary_argc; i++) { slurm_info("argv[%d]: %s\n", i, binary_argv[i]); } return 0; } ``` ``` $ cc -shared -lslurm librepro.c -o librepro.so ``` Added `optional .../librepro.so` to Plugstack config file.
Looks like I already opened a bug on this (issue fixed in later release) *** This ticket has been marked as a duplicate of ticket 16673 ***