Skip to content

Conversation

@hjelmn
Copy link
Member

@hjelmn hjelmn commented Apr 9, 2015

putenv requires that any string put into the environment is not
changed or freed. That is not the case with constant strings as they
will go away when dlclose is called on the component. Instead, just
use setenv which does not have this restriction.

Signed-off-by: Nathan Hjelm hjelmn@lanl.gov

@hjelmn
Copy link
Member Author

hjelmn commented Apr 9, 2015

@rhc Was seeing SEGV in getenv due to ess/singleton. This commit fixes it. Probably applies to 1.8 as well.

@hjelmn hjelmn changed the title ess/singleton: do not put componet strings into the environment ess/singleton: do not put component strings into the environment Apr 9, 2015
@hjelmn hjelmn added the bug label Apr 9, 2015
@rhc54
Copy link
Contributor

rhc54 commented Apr 9, 2015

@hjelmn I think we've been standardizing on opal_setenv instead of using setenv itself.

@hjelmn
Copy link
Member Author

hjelmn commented Apr 9, 2015

Ok, I will update the commit.

@hjelmn
Copy link
Member Author

hjelmn commented Apr 9, 2015

@rhc54 Fixed. Also changed the unsetenv calls to use opal_unsetenv.

putenv requires that any string put into the environment is not
changed or freed. That is not the case with constant strings as they
will go away when dlclose is called on the component. Instead, just
use opal_setenv which does not have this restriction.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
@hjelmn
Copy link
Member Author

hjelmn commented Apr 9, 2015

Ok. Merging and will open a PR for 1.8.5

hjelmn added a commit that referenced this pull request Apr 9, 2015
ess/singleton: do not put component strings into the environment
@hjelmn hjelmn merged commit 2be769b into open-mpi:master Apr 9, 2015
@mellanox-github
Copy link

Refer to this link for build results (access rights to CI server needed):
http://bgate.mellanox.com/jenkins/job/gh-ompi-master-pr/425/
Test PASSed.

@mellanox-github
Copy link

Refer to this link for build results (access rights to CI server needed):
http://bgate.mellanox.com/jenkins/job/gh-ompi-master-pr/426/
Test PASSed.

jsquyres added a commit to jsquyres/ompi that referenced this pull request Nov 10, 2015
@hjelmn hjelmn deleted the putenv_fix branch May 23, 2016 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants