-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
std.process execve depends on environ pointer not changing #10574
Comments
schveiguy
added a commit
to schveiguy/phobos
that referenced
this issue
Dec 5, 2024
…causing segfault in child process.
schveiguy
added a commit
to schveiguy/phobos
that referenced
this issue
Dec 5, 2024
…causing segfault in child process.
schveiguy
added a commit
to schveiguy/phobos
that referenced
this issue
Dec 5, 2024
…causing segfault in child process.
schveiguy
added a commit
to schveiguy/phobos
that referenced
this issue
Dec 7, 2024
…causing segfault in child process.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Been running down a spurious failure in a work project.
Every so often a
std.process.execute
fails onexecve
. The error is EFAULT or Bad Address.What is happening is that std.process is using the default
environ
pointer when no environment is provided.However, it stores this in a local pointer. And then later on uses that local pointer inside the child process.
The problem is that in the time between calling
std.process.execute
(or something else) and the time the fork is run, theenviron
pointer has changed (because e.g. someone added a new environment variable in another thread). Becauseenviron
is C allocated, the old pointer is deallocated. In this case, the pointer points at unallocated memory, and theexecve
fails.Will be adding a fix shortly.
The text was updated successfully, but these errors were encountered: