-
Notifications
You must be signed in to change notification settings - Fork 82
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
Bad address when using relative cwd and setting env #219
Comments
Good call. Let me do a little manual bisect with |
I can confirm process-1.6.12.0 does not reproduce the issue, and process-1.6.13.1 does. I cannot test process-1.6.13.0 because I get a different error,
|
😬 😱 |
Apologies for missing this earlier, @snoyberg! I'll investigate. |
Yes, I see the problem here. |
When `execvpe` is not available we use `find_executable` to search for the executable prior to `fork`ing (fixing GHC #19994). However, previously we failed to account for the fact that `exec` will be called from a different working directory than that of the spawning process if the user has set `cwd`. Fix this by teaching `find_executable` to search relative to the requested working directory. Fixes haskell#219.
When `execvpe` is not available we use `find_executable` to search for the executable prior to `fork`ing (fixing GHC #19994). However, previously we failed to account for the fact that `exec` will be called from a different working directory than that of the spawning process if the user has set `cwd`. Fix this by teaching `find_executable` to search relative to the requested working directory. Fixes haskell#219.
When `execvpe` is not available we use `find_executable` to search for the executable prior to `fork`ing (fixing GHC #19994). However, previously we failed to account for the fact that `exec` will be called from a different working directory than that of the spawning process if the user has set `cwd`. Fix this by teaching `find_executable` to search relative to the requested working directory. Fixes #219.
I started getting a
Bad address
error when executing processes after updating fromlts-18.5
tolts-18.10
, which bringsprocess
fromv1.6.9.0
tov1.6.13.2
. It seems to be related to settingcwd
andenv
in theCreateProcess
.Everything works fine if you don't change
env
. You can touchenv
, if you don't changecwd
too. You can changeenv
and changecwd
, but depending on what you are changingcwd
to and how that affects the command. For example,cwd = /bin
and a command of./true
works fine even when changingenv
. Unfortunately, I have not been able to narrow down the pattern in that last variability. Note that settingcwd
to.
(or the full path to.
) does not count as "change" for this issue, but settingenv
to the result ofgetEnvironment
does. Straight-forward, right?So, there are a lot of different combinations that trigger it, but here is one minimal repro:
Works in 18.5, not in 18.10:
Note that it is indeed isolated to
process
: I can use18.10
with anextra-dep
ofprocess-1.6.9.0
and the bug goes away. I'm just not showing it that way because it requires more setup to repro.I experienced this in
typed-process
(usingsetWorkingDir
andsetEnv
), but eventually found the bug to be here.The text was updated successfully, but these errors were encountered: