Like the documentation for our set_var (setenv) says, care must be taken with mutating environment variables in a multithreaded program. See this glibc bug #13271 that says getaddrinfo may call getenv.
It looks like we have an unsynchronized call to getaddrinfo and this may cause trouble with glibc/Linux.
Seeing glibc's attitude to setenv in multithreaded programs, set_var seems like a big hazard in general(?).
Discovered as an issue tangential to #27966
cc @alexcrichton
Like the documentation for our
set_var(setenv) says, care must be taken with mutating environment variables in a multithreaded program. See this glibc bug #13271 that says getaddrinfo may call getenv.It looks like we have an unsynchronized call to getaddrinfo and this may cause trouble with glibc/Linux.
Seeing glibc's attitude to setenv in multithreaded programs,
set_varseems like a big hazard in general(?).Discovered as an issue tangential to #27966
cc @alexcrichton