ESMCI / ESMCI/cime

length of local variable file in GPTLget_memusage too short

Closed
#5,052 2 comments 0 reactions 1 assignee Claimed by @billsacks View on GitHub
Dominant language
Python
Stars
174
Forks
225
Avg merge
3d 10h
Merged PRs (30d)
18

Description

Some experiments on derecho using an old version of CIME are getting the error
get_memusage: pid NNNNNNN is too large
where NNNNNNN is a number larger than 999999.
The check on the pid appears to be there to ensure that writing to the local char array `file` a string containing the pid doesn't write past the end of `file`.
The error was addressed in https://github.com/ESMCI/cime/commit/96b4dd13005642fb460c944a872999487ac56b09 by changing the conditional `pid > 999999` to `pid <= 0`.
However, if `pid` exceeds 999999, as is currently happening on derecho, then the write to `file` will silently write past the end of `file`.
It seems like the length of the variable `file` should be increased to accommodate 7 digit pids.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.