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

::getenv is not guaranteed to be thread safe #28073

Closed
Dr15Jones opened this issue Sep 26, 2019 · 13 comments
Closed

::getenv is not guaranteed to be thread safe #28073

Dr15Jones opened this issue Sep 26, 2019 · 13 comments

Comments

@Dr15Jones
Copy link
Contributor

The POSIX and C standard state that muliple calls to ::getenv are not guaranteed to be thread safe. The C++ standard std::getenv is thread safe. We should change all uses of ::getenv in CMSSW to use std::getenv.

@Dr15Jones
Copy link
Contributor Author

assign core, reconstruction, simulation, dam

@cmsbuild
Copy link
Contributor

New categories assigned: core,reconstruction,simulation

@Dr15Jones,@smuzaffar,@mdhildreth,@slava77,@perrotta,@civanch you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

A new Issue was created by @Dr15Jones Chris Jones.

@davidlange6, @Dr15Jones, @smuzaffar, @fabiocos, @kpedro88 can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@civanch
Copy link
Contributor

civanch commented Sep 26, 2019

@Dr15Jones , Geant4 has a lot of calls to environment in order to access data files. Should we inform Geant4 about this problem?

@Dr15Jones
Copy link
Contributor Author

@civanch

Should we inform Geant4 about this problem?

That's probably a good idea.

@Dr15Jones
Copy link
Contributor Author

#28117 changes all code for core.

@fabiocos
Copy link
Contributor

fabiocos commented Oct 7, 2019

@Dr15Jones @smuzaffar preparing a PR to change all the rest...

@Dr15Jones
Copy link
Contributor Author

#28124 does the rest

@perrotta
Copy link
Contributor

perrotta commented Nov 7, 2019

@Dr15Jones , I can still find three ::getenv in CMSSW after your #28117 and #28124, namely:

  • two in CondCore/Utilities/bin/cmscond_authentication_manager.cpp
  • one in OnlineDB/EcalCondDB/bin/cmsecal_write_offline_det_id.cpp

Were they just got forgotten, or maybe that code is not to be run multithread?

@Dr15Jones
Copy link
Contributor Author

@perrotta given both are stand alone programs, they were going to cause a problem for cmsRun :).

@perrotta
Copy link
Contributor

perrotta commented Nov 7, 2019

@civanch
Copy link
Contributor

civanch commented Dec 3, 2019

The issue is fixed in Geant4 10.6 in all classes related to CMS productions.

@civanch
Copy link
Contributor

civanch commented Dec 3, 2019

+1

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

6 participants