# Cabal segfault on MacOS Ventura

**URL:** <https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862>\
**Category:** Uncategorized\
**Created:** [February 24, 2023, 6:50pm UTC](https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862 "2023-02-24T18:50:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![santiweight](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/santiweight/32/1187_2.png) [@santiweight](https://discourse.haskell.org/u/santiweight)\
**Post date:** [February 24, 2023, 6:50pm UTC](https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862/1 "2023-02-24T18:50:20Z")

</div>

```haskell
Cabal: Failed to build slam-0.0.0.1 because it depends on slam-0.0.0.1 which
itself failed to build.
Failed to build servant-server-0.19.2 because it depends on
servant-server-0.19.2 which itself failed to build.
Failed to build w-lggr-2.4.0-4fd1f823. The failure occurred during the
configure step. The build process segfaulted (i.e. SIGSEGV).
Failed to build wai-app-static-3.1.7.4 because it depends on
wai-app-static-3.1.7.4 which itself failed to build.
Failed to build wai-extra-3.1.13.0 because it depends on wai-extra-3.1.13.0
which itself failed to build.

```

It’s a private codebase, so I can’t share. Perhaps others have been running into similar issues?

Coworker updated to MacOS Ventura last night, reinstalled xcode tools this morning. This is the error he’s getting.

Versions:

- Cabal 3.8.1.0 and 3.6.2.0 (neither works)
- GHC 9.2.4

---

<div class="post-metadata">

**Author:** ![santiweight](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/santiweight/32/1187_2.png) [@santiweight](https://discourse.haskell.org/u/santiweight)\
**Post date:** [February 24, 2023, 7:01pm UTC](https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862/2 "2023-02-24T19:01:25Z")

</div>

Update. It’s also failing on random other packages after a cabal nuking, with exactly the same error but for different package names. We’re performing a full nuking of ghcup and everything haskell-related.

```haskell
CallStack (from HasCallStack):
  withMetadata, called at src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0-inplace:Distribution.Simple.Utils
Error: Cabal: Failed to build lngg-pythn-0.5.8-3f00cd65. The build process
segfaulted (i.e. SIGSEGV).
Failed to build parcel-0.1.0.0 because it depends on parcel-0.1.0.0 which
itself failed to build.
Failed to build servant-py-0.1.1.1 because it depends on servant-py-0.1.1.1
which itself failed to build.
Failed to build slam-0.0.0.1 because it depends on slam-0.0.0.1 which itself
failed to build.

```

---

<div class="post-metadata">

**Author:** ![f-a](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/f-a/32/2740_2.png) [@f-a](https://discourse.haskell.org/u/f-a)\
**Post date:** [February 24, 2023, 7:16pm UTC](https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862/3 "2023-02-24T19:16:40Z")

</div>

Opening an issue [on cabal repo](https://github.com/haskell/cabal/) might get more eyes on the error.

---

<div class="post-metadata">

**Author:** ![santiweight](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/santiweight/32/1187_2.png) [@santiweight](https://discourse.haskell.org/u/santiweight)\
**Post date:** [February 24, 2023, 7:20pm UTC](https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862/4 "2023-02-24T19:20:48Z")

</div>

Solution found…

```haskell
rm -rf ~/.cabal
ghcup nuke 
# we manually uninstalled every GHC/cabal before nuking
# wasn't clear from ghcup nuke -h whether ghcup nuke
# would delete them for us
### Restart computer
### Update our toolchain to use ghc-9.2.5

```

This caused the error to go away. I have no idea why we had the issue. Very likely some subtlety due the reinstalling xcode toolchain.

---

<div class="post-metadata">

**Author:** ![Bodigrim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/bodigrim/32/1457_2.png) [@Bodigrim](https://discourse.haskell.org/u/Bodigrim)\
**Post date:** [February 24, 2023, 7:43pm UTC](https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862/5 "2023-02-24T19:43:10Z")

</div>

Nothing particularly subtle here, you could have just installed GHC 9.2.5 without nuking everything. GHC 9.2.4 does not work on macOS Ventura.

---

<div class="post-metadata">

**Author:** ![santiweight](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/santiweight/32/1187_2.png) [@santiweight](https://discourse.haskell.org/u/santiweight)\
**Post date:** [February 24, 2023, 8:18pm UTC](https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862/6 "2023-02-24T20:18:19Z")

</div>

Thanks - that’s a little silly of me (though it was not obvious to me how to know such things).

---

<div class="post-metadata">

**Author:** ![bgamari](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/bgamari/32/3599_2.png) [@bgamari](https://discourse.haskell.org/u/bgamari)\
**Post date:** [February 25, 2023, 3:54am UTC](https://discourse.haskell.org/t/cabal-segfault-on-macos-ventura/5862/7 "2023-02-25T03:54:47Z")

</div>

Indeed you were very likely seeing [GHC #22497](https://gitlab.haskell.org/ghc/ghc/-/issues/22497), which ended up being due to an upstream bug in the `gmp` library.
