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

Type conversion oddness in Lua spank:get_item #3

Closed
GoogleCodeExporter opened this issue May 12, 2015 · 2 comments
Closed

Type conversion oddness in Lua spank:get_item #3

GoogleCodeExporter opened this issue May 12, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

We are seeing unexpected results from the Lua function spank:get_item in 
version 0.23 built as an RPM on SL6.3 (gcc 4.4.6-4).

Sample Lua program (note that the values are printed in hex):
function slurm_spank_task_init_privileged (spank)
  SPANK.log_info("NCPUS = %x", spank:get_item('S_JOB_NCPUS'))
  SPANK.log_info("UID = %x", spank:get_item('S_JOB_UID'))
end

Output (single-core job run as root):
Sep  5 19:35:43 localhost slurmd[linux0][30130]: NCPUS = 100000001
Sep  5 19:35:43 localhost slurmd[linux0][30130]: UID = 7274732000000000

It appears that the 8-byte long "val" in lua.c:l_spank_get_item_val() is only 
partially set in the call to spank_get_item(). The lower 16 bits are set when 
retrieving S_JOB_NCPUS and the lower 32 are set for S_JOB_UID.

Initializing val appeared to resolve the issue. (In replicating this problem, 
we only saw invalid UID values when lua.so was compiled with -O1 and higher. 
Invalid NCPUS values were present with no optimization.)

Regards,
John

Original issue reported on code.google.com by [email protected] on 6 Sep 2012 at 12:48

Attachments:

@nlqq
Copy link

nlqq commented Feb 8, 2022

Hi there, this patch file link has become invalid, does it has backup or 0.40 version has already not need this patch ?

@grondo
Copy link
Owner

grondo commented Feb 8, 2022

I believe this is fixed in the latest version, please see chaos/slurm-spank-plugins as the new upstream repo.

@grondo grondo closed this as completed Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants