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

OPAL: fix string buffer allocation for large env variables #8144

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

devreal
Copy link
Contributor

@devreal devreal commented Oct 27, 2020

In OPAL's keyval parser in add_to_env_str, for the first variable a buffer of size 1024 was allocated, regardless of the space needed. For any additional variables, the size might have been doubled at best, even if more space was required. This PR makes sure the allocated buffer is sufficiently large to store the value.

See #8117

Note: the issue described in #8117 does not seem to occur on master. I will backport this to 4.0.x (where it occurs) and 4.1.x (not tested yet) but the same code exists in PMIX and PRRTE so it should be picked up there as well.

Signed-off-by: Joseph Schuchart schuchart@icl.utk.edu

opal/util/keyval_parse.c Outdated Show resolved Hide resolved
@jsquyres
Copy link
Member

FYI @rhc54 @jjhursey for the "we should also do this in PMIX and PRRTE" note.

Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
@devreal devreal force-pushed the fix_opal_add_to_env_str_alloc branch from ad5a432 to 320a9a1 Compare October 30, 2020 13:28
@jsquyres
Copy link
Member

Please also update #8155 and #8156. Thanks!

rhc54 added a commit to rhc54/openpmix that referenced this pull request Oct 30, 2020
Track open-mpi/ompi#8144

Signed-off-by: Ralph Castain <rhc@pmix.org>
rhc54 added a commit to rhc54/prrte that referenced this pull request Oct 30, 2020
Track open-mpi/ompi#8144

Also fix minor example issue

Signed-off-by: Ralph Castain <rhc@pmix.org>
@jsquyres jsquyres merged commit dca2058 into open-mpi:master Oct 30, 2020
@devreal devreal deleted the fix_opal_add_to_env_str_alloc branch October 3, 2022 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants