ompi icon indicating copy to clipboard operation
ompi copied to clipboard

segfault due to thread-unsafe getenv() call

Open zsalvet opened this issue 2 months ago • 18 comments

Background information

What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)

v4.1.3, v4.1.8

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

from distribution tarball using Spack

If you are building/installing from a git clone, please copy-n-paste the output from git submodule status.

Please describe the system on which you are running

  • Operating system/version: Debian Linux 12
  • Computer hardware: x86_64
  • Network type:

Details of the problem

model_callback() in ompi/interlib/interlib.c contains getenv() call which is not thread-safe and can cause segfault when some other thread is manipulating environment at the same time (IMO, environmental variables should only be accessed only from main thread in MPI_Init{,_thread} )

zsalvet avatar Oct 09 '25 13:10 zsalvet