cbits/fork-exec: Don't dup2 identical fds#250
Merged
snoyberg merged 1 commit intohaskell:masterfrom Jun 15, 2022
Merged
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.
Contributor
|
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. |
Contributor
Author
|
Hmm, this is quite mysterious. Are you certain that you are linking against the correct |
Contributor
|
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 |
psibi
approved these changes
Jun 15, 2022
Contributor
psibi
left a comment
There was a problem hiding this comment.
This fixes the dup2 issue that was being reproduced in the stack codebase.
snoyberg
added a commit
that referenced
this pull request
Jun 15, 2022
Collaborator
|
Thanks @bgamari! |
2 tasks
mpilgrem
added a commit
to commercialhaskell/stack
that referenced
this pull request
Aug 3, 2022
Includes fix haskell/process#250
mpilgrem
added a commit
to commercialhaskell/stack
that referenced
this pull request
Aug 12, 2022
Includes fix haskell/process#250
mpilgrem
added a commit
to commercialhaskell/stack
that referenced
this pull request
Aug 12, 2022
Includes fix haskell/process#250
mpilgrem
pushed a commit
to commercialhaskell/stack
that referenced
this pull request
Aug 13, 2022
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
Mistuke
pushed a commit
to Mistuke/process
that referenced
this pull request
Mar 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Darwin violates POSIX by making
dup2(x,x), which should be a no-op, error. Consequently, we must takecare not to
dup2in such cases.We had already made this change in the
posix_spawnpcodepath but I hadassumed that this only affected
posix_spawnp, not thedup2systemcall itself.
See also: #214