-
Notifications
You must be signed in to change notification settings - Fork 84
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
cbits/fork-exec: Don't dup2 identical fds #250
Conversation
Darwin violates POSIX by making `dup2(x,x)`, which should be a no-op, error. Consequently, we must take care not to `dup2` in such cases. We had already made this change in the `posix_spawnp` codepath but I had assumed that this *only* affected `posix_spawnp`, not the `dup2` system call itself.
I compiled Stack using this patch, but I'm still able to reproduce the issue when running stack's integration test. Some relevant logs:
Unfortunately I haven't been able to find a minimal reproducible example. |
Hmm, this is quite mysterious. Are you certain that you are linking against the correct |
I mis-applied your patch, I rebased your changes against master branch and it indeed fixes the issue. Relevant logs:
Although I'm still able to reproduce the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the dup2 issue that was being reproduced in the stack codebase.
Thanks @bgamari! |
Includes fix haskell/process#250
Includes fix haskell/process#250
Includes fix haskell/process#250
Bump to nightly-2022-07-30 Remove redundant import in Stack.Package Bump to nightly-2022-08-02 (GHC 9.2.4) Fix 4101-dependency-tree test Maybe fix the ghc-install-hooks test process-1.6.15.0 now available Includes fix haskell/process#250
Darwin violates POSIX by making
dup2(x,x)
, which should be a no-op, error. Consequently, we must takecare not to
dup2
in such cases.We had already made this change in the
posix_spawnp
codepath but I hadassumed that this only affected
posix_spawnp
, not thedup2
systemcall itself.
See also: #214