Skip to content

Segfault in GC in GHC 8.10.{3,4}

Summary

A bunch of segfaults:

ghc:w[92225]: segfault at 40df5c48 ip 000000000040b245 sp 00007fe3d97fca90 error 4 in ghc[400000+3715000]
ghc:w[94312]: segfault at 45131c48 ip 000000000040b245 sp 00007f68a2bfda90 error 4 in ghc[400000+3715000]
ghc:w[31098]: segfault at 40106938 ip 000000000040b3b5 sp 00007fc1557fca90 error 4 in ghc[400000+36df000]
ghc:w[42775]: segfault at 408eb9e0 ip 000000000040b3b5 sp 00007f8536bfda90 error 4 in ghc[400000+36df000]
ghc:w[44907]: segfault at 414699e0 ip 000000000040b3b5 sp 00007f01c7ffea90 error 4 in ghc[400000+36df000]
ghc:w[49393]: segfault at 40743808 ip 000000000040b3b5 sp 00007ff38bffea90 error 4 in ghc[400000+36df000]
ghc:w[62845]: segfault at 43c089e0 ip 000000000040b3b5 sp 00007f18aebfda90 error 4 in ghc[400000+36df000]
$ addr2line -e .../lib/ghc-8.10.4/bin/ghc 000000000040b3b5
.../rts/sm/Evac.c:686
$ addr2line -e .../lib/ghc-8.10.4/bin/ghc 000000000040b245
.../rts/sm/Evac.c:445

On 8.10.3 we've also saw it happen in rts/sm/Evac.c:839

Steps to reproduce

Building ghcide 0.7.3.0 (library):

runhaskell Setup configure \
  # ... package db flags
  --enable-debug-info \
  --disable-library-stripping \
  --disable-library-for-ghci \
  --ghc-option=-j \
  --enable-shared \
  --enable-library-profiling \

runhaskell Setup build \
  --verbose=2 \
  --ghc-option=-Wno-deprecated-flags \
  --ghc-option=-haddock \
  '--ghc-options=+RTS -A128M -n4m -RTS'

The build command fails while building the main library. It does not happen every time. If I remove cabal's --enable-shared (implying GHC's -dynamic-too) it does not happen.

Environment

  • GHC version used: 8.10.3 and 8.10.4. GHC is built with DYNAMIC_GHC_PROGRAMS=NO and GhcStage2HcOpts+=-eventlog.

Optional:

  • Operating System: redhat linux
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information