Skip to content
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

Enable ghc mmap crash workaround for every ghc compiled binary #2572

Merged
merged 3 commits into from
Sep 6, 2023

Conversation

leonschoorl
Copy link
Member

@leonschoorl leonschoorl commented Aug 29, 2023

In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages.
That flag added -with-rtsopts=-xm20000000 to some of our binaries.

But other binaries would occasionally still trigger the mmap bug,
most importantly ghc itself.

This commit undoes the previous way of applying the workaround and
applies the same -xm20000000 RTS option everywhere
via the GHCRTS environment variable.

But for this to work we have to link all binaries with the -rtsopts
flag, otherwise they'll just ignore the GHCRTS.
Unfortunately this is impossible for custom setups, like used by clash-cosim and clash-ffi-example.
Therefor we clear the GHCRTS variable when building just those packages. And hope we don't hit the mmap issue while building those.

Still TODO:

  • Write a changelog entry (see changelog/README.md)
  • Check copyright notices are up to date in edited files

@leonschoorl leonschoorl force-pushed the workaround-mmap-bug-everywhere branch 9 times, most recently from 9642647 to f52d2e8 Compare August 31, 2023 15:04
Copy link
Member

@martijnbastiaan martijnbastiaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a mess :(

.ci/gitlab/test.yml Outdated Show resolved Hide resolved
In PRs #2444 we added the workaround-ghc-mmap-crash flag on
some of our packages.
That flag added `-with-rtsopts=-xm20000000` to some of our binaries.

But other binaries would occasionally still trigger the mmap bug,
most importantly ghc itself.

This commit undoes the previous way of applying the workaround and
applies the same `-xm20000000` RTS option everywhere
via the GHCRTS environment variable.

But for this to work we have to link all binaries with the `-rtsopts`
flag, otherwise they'll error out that the GHCRTS contains
unsupported options.
They use custom setups and it is seemingly impossible to get them to link with
anything other than the default -rtsopts=some
Making them always throw an error when GHCRTS="-xm..."
So we don't have to deal the mmap errors on CI
@leonschoorl leonschoorl force-pushed the workaround-mmap-bug-everywhere branch 2 times, most recently from 55dfc63 to 9b62e21 Compare September 6, 2023 15:15
@leonschoorl leonschoorl merged commit 8ec6e24 into master Sep 6, 2023
12 checks passed
@leonschoorl leonschoorl deleted the workaround-mmap-bug-everywhere branch September 6, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants