You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yet, all the members of the environment class are marked @safe or @trusted.
As an example, setting an environment variable on one thread, and reading it on another thread, could call setenv and getenv respectively. These functions are not thread safe, and getenv can easily return memory that is deallocated. I've even had getenvitself segfault, because it is iterating the environment pointer as it is being realloc'd in another thread.
We should lock around any reading or manipulation of environment. We can't mark these functions as not safe at this point.
The text was updated successfully, but these errors were encountered:
Yet, all the members of the
environment
class are marked@safe
or@trusted
.As an example, setting an environment variable on one thread, and reading it on another thread, could call
setenv
andgetenv
respectively. These functions are not thread safe, andgetenv
can easily return memory that is deallocated. I've even hadgetenv
itself segfault, because it is iterating the environment pointer as it is being realloc'd in another thread.We should lock around any reading or manipulation of environment. We can't mark these functions as not safe at this point.
The text was updated successfully, but these errors were encountered: