Skip to content

Prevent a segfault in createProcess on Mac - #296

Merged
snoyberg merged 1 commit into
haskell:masterfrom
neilmayhew:no-cwd-segfault-mac
Jul 31, 2023
Merged

snoyberg merged 1 commit into
haskell:masterfrom
neilmayhew:no-cwd-segfault-mac

Conversation

@neilmayhew

Copy link
Copy Markdown
Contributor

The new test segfaults without the corresponding change in find_in_search_path

Using . is slightly less efficient than not using a working directory at all, but it avoids adding a third code branch and the consequent additional duplication of sprintf code.

Closes #295

@neilmayhew

neilmayhew commented Jul 25, 2023 •

Copy link
Copy Markdown
Contributor Author

I tested this on Mac and Linux as follows:

nix-shell --pure -p haskell.compiler.ghc945 autoconf
autoreconf -i
ghc Setup.hs
./Setup configure --enable-tests
./Setup build
./Setup test

@snoyberg
snoyberg requested a review from bgamari July 25, 2023 18:23
@bgamari

bgamari commented Jul 31, 2023

Copy link
Copy Markdown
Contributor

Thank you, @neilmayhew ! This looks good.

@snoyberg
snoyberg merged commit 5326f67 into haskell:master Jul 31, 2023
@neilmayhew

Copy link
Copy Markdown
Contributor Author

Thanks for approving and merging.

Since this is a boot package, I assume it will be a while before the fix gets into a version that we can use in an application.

Is there any chance this would be backported into a version of ghc 9.4? Or is there now a way to use a non-default version of a boot package?

@Bodigrim

Bodigrim commented Jul 31, 2023 •

Copy link
Copy Markdown
Contributor

Or is there now a way to use a non-default version of a boot package?

It depends on your other dependencies, but with process you can likely say cabal build --constraint 'process >= X.Y.Z' and Cabal will rebuild everything in the world.

GHC 9.4.6 is in works right now, you might want to chime in https://gitlab.haskell.org/ghc/ghc/-/issues/23760 and https://gitlab.haskell.org/ghc/ghc/-/issues/23710

@andreasabel

Copy link
Copy Markdown
Member

I chimed in on https://gitlab.haskell.org/ghc/ghc/-/issues/23760 because not even GHCs 9.4.7 and 9.6.3 contain this important bugfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

createProcess segfaults on Mac

5 participants