An error occurred while fetching the assigned iteration of the selected issue.
Stack smashing occurs when building some packages
Summary
On Ubuntu 20.04, with a fully patched kernel, ghc
is killed when linking (I think) by the OS because the OS detected stack smashing (writing past the bounds of the stack).
This has been a reoccurring probelm for me on my machine for 8 months. Quite debilitating for Haskell development.
Steps to reproduce
Have an Ubuntu machine with kernel image initrd.img-5.8.0-63
and run the following:
$ systemctl enable apport.service # Because Ubuntu
$ ulimit -c unlimited
$ git clone https://github.com/RyanGlScott/text-show
$ cd text-show
$ cabal build . # For dependencies
Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
- text-show-3.9 (lib) (first run)
Configuring library for text-show-3.9..
Preprocessing library for text-show-3.9..
Building library for text-show-3.9..
[ 1 of 66] Compiling TextShow.Data.OldTypeable ( src/TextShow/Data/OldTypeable.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Data/OldTypeable.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Data/OldTypeable.dyn_o )
[ 2 of 66] Compiling TextShow.GHC.Conc.Windows ( src/TextShow/GHC/Conc/Windows.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/GHC/Conc/Windows.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/GHC/Conc/Windows.dyn_o )
[ 3 of 66] Compiling TextShow.GHC.Stats ( src/TextShow/GHC/Stats.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/GHC/Stats.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/GHC/Stats.dyn_o )
[ 4 of 66] Compiling TextShow.Options ( src/TextShow/Options.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Options.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Options.dyn_o )
[ 5 of 66] Compiling TextShow.TH.Names ( shared/TextShow/TH/Names.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/TH/Names.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/TH/Names.dyn_o )
[ 6 of 66] Compiling TextShow.Utils ( src/TextShow/Utils.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Utils.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Utils.dyn_o )
[ 7 of 66] Compiling TextShow.Classes ( src/TextShow/Classes.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Classes.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Classes.dyn_o )
[ 8 of 66] Compiling TextShow.TH.Internal ( src/TextShow/TH/Internal.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/TH/Internal.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/TH/Internal.dyn_o )
[ 9 of 66] Compiling TextShow.Data.Tuple ( src/TextShow/Data/Tuple.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Data/Tuple.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Data/Tuple.dyn_o )
*** stack smashing detected ***: terminated
cabal: Failed to build text-show-3.9. The build process terminated with exit
code -6
$ echo "That -6 error shouldn't happen!"
$ cabal build -v3 2>&1 | tail -n 15
/home/recursion-ninja/.ghcup/bin/ghc --make -fbuilding-cabal-package -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -odir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -hidir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -stubdir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -i -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -isrc -ishared -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/global-autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/global-autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -Iinclude -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/include -optP-DNEW_FUNCTOR_CLASSES -optP-DNEW_FUNCTOR_CLASSES -optP-include -optP/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen/cabal_macros.h -this-unit-id text-show-3.9-inplace -hide-all-packages -Wmissing-home-modules -no-user-package-db -package-db /home/recursion-ninja/.cabal/store/ghc-9.0.1/package.db -package-db /home/recursion-ninja/Code/text-show/dist-newstyle/packagedb/ghc-9.0.1 -package-db /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/package.conf.inplace -package-id array-0.5.4.0 -package-id base-4.15.0.0 -package-id base-compat-batteries-0.11.2-dc2f9df945acedea868b07c7137de52d26b56e86904a6943da4a304170856265 -package-id bifunctors-5.5.11-2a3841d53457ffc1384c87930764a68d23b0847db853b89257d3078136df7f30 -package-id bytestring-0.10.12.1 -package-id bytestring-builder-0.10.8.2.0-f1fc0db34ded57ac80a7a16014cd0244372b73c4501aa1b8f94948da8ee98daa -package-id containers-0.6.4.1 -package-id generic-deriving-1.14-60cf634e0d5e72a427899f654aec208994b91f68d01fb801568599238e6072e6 -package-id ghc-boot-th-9.0.1 -package-id ghc-prim-0.7.0 -package-id integer-gmp-1.1 -package-id template-haskell-2.17.0.0 -package-id text-1.2.4.1 -package-id th-abstraction-0.4.2.0-97bfd77d8a680b19c286c078730c0f3ae84c5d9a6ac20db1acc36cdd9250e6d4 -package-id th-lift-0.8.2-0fa84c263173fc179670fe14cfd1a7e9068a8c3619afca23dfafbdaecc45d44b -package-id transformers-0.5.6.2 -package-id transformers-compat-0.6.6-5b8dcd1799d8b869b303cd54c9e5f8e0e781d80c42b5cdde1476265310540ee2 -XHaskell2010 TextShow TextShow.Control.Applicative TextShow.Control.Concurrent TextShow.Control.Exception TextShow.Control.Monad.ST TextShow.Data.Array TextShow.Data.Bool TextShow.Data.ByteString TextShow.Data.Char TextShow.Data.Complex TextShow.Data.Data TextShow.Data.Dynamic TextShow.Data.Either TextShow.Data.Fixed TextShow.Data.Floating TextShow.Data.Functor.Compose TextShow.Data.Functor.Identity TextShow.Data.Functor.Product TextShow.Data.Functor.Sum TextShow.Debug.Trace TextShow.Debug.Trace.Generic TextShow.Debug.Trace.TH TextShow.Generic TextShow.Data.Integral TextShow.Data.List TextShow.Data.List.NonEmpty TextShow.Data.Maybe TextShow.Data.Monoid TextShow.Data.Ord TextShow.Data.Proxy TextShow.Data.Ratio TextShow.Data.Semigroup TextShow.Data.Text TextShow.Data.Tuple TextShow.Data.Typeable TextShow.Data.Version TextShow.Data.Void TextShow.Foreign.C.Types TextShow.Foreign.Ptr TextShow.Functions TextShow.GHC.Fingerprint TextShow.GHC.Generics TextShow.GHC.Stats TextShow.Numeric.Natural TextShow.System.Exit TextShow.System.IO TextShow.System.Posix.Types TextShow.Text.Read TextShow.TH TextShow.GHC.Conc.Windows TextShow.GHC.Event TextShow.GHC.TypeLits TextShow.Data.Type.Coercion TextShow.Data.Type.Equality TextShow.Data.OldTypeable TextShow.GHC.RTS.Flags TextShow.GHC.StaticPtr TextShow.GHC.Stack TextShow.Classes TextShow.Data.Typeable.Utils TextShow.FromStringTextShow TextShow.Instances TextShow.Options TextShow.TH.Internal TextShow.TH.Names TextShow.Utils -Wall -Wno-star-is-type -hide-all-packages
[ 9 of 66] Compiling TextShow.Data.Tuple ( src/TextShow/Data/Tuple.hs, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Data/Tuple.o, /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/TextShow/Data/Tuple.dyn_o )
*** stack smashing detected ***: terminated
/home/recursion-ninja/.ghcup/bin/ghc returned ExitFailure (-6)
packages definitely up to date:
packages previously probably up to date:
packages now probably up to date:
packages newly up to date:
packages out to date: text-show-3.9-inplace, text-show-3.9-inplace-bench, text-show-3.9-inplace-spec
packages invalid due to dep change: text-show-3.9-inplace, text-show-3.9-inplace-bench, text-show-3.9-inplace-spec
packages invalid due to build failure: text-show-3.9-inplace
cabal: Failed to build text-show-3.9-inplace. The build process terminated
with exit code -6
$ echo "Looks like stacksmashing occured while building. Lets re-run the GHC invocation with -v3:"
$ /home/recursion-ninja/.ghcup/bin/ghc --make -fbuilding-cabal-package -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -odir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -hidir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -stubdir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -i -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -isrc -ishared -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/global-autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/global-autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -Iinclude -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/include -optP-DNEW_FUNCTOR_CLASSES -optP-DNEW_FUNCTOR_CLASSES -optP-include -optP/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen/cabal_macros.h -this-unit-id text-show-3.9-inplace -hide-all-packages -Wmissing-home-modules -no-user-package-db -package-db /home/recursion-ninja/.cabal/store/ghc-9.0.1/package.db -package-db /home/recursion-ninja/Code/text-show/dist-newstyle/packagedb/ghc-9.0.1 -package-db /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/package.conf.inplace -package-id array-0.5.4.0 -package-id base-4.15.0.0 -package-id base-compat-batteries-0.11.2-dc2f9df945acedea868b07c7137de52d26b56e86904a6943da4a304170856265 -package-id bifunctors-5.5.11-2a3841d53457ffc1384c87930764a68d23b0847db853b89257d3078136df7f30 -package-id bytestring-0.10.12.1 -package-id bytestring-builder-0.10.8.2.0-f1fc0db34ded57ac80a7a16014cd0244372b73c4501aa1b8f94948da8ee98daa -package-id containers-0.6.4.1 -package-id generic-deriving-1.14-60cf634e0d5e72a427899f654aec208994b91f68d01fb801568599238e6072e6 -package-id ghc-boot-th-9.0.1 -package-id ghc-prim-0.7.0 -package-id integer-gmp-1.1 -package-id template-haskell-2.17.0.0 -package-id text-1.2.4.1 -package-id th-abstraction-0.4.2.0-97bfd77d8a680b19c286c078730c0f3ae84c5d9a6ac20db1acc36cdd9250e6d4 -package-id th-lift-0.8.2-0fa84c263173fc179670fe14cfd1a7e9068a8c3619afca23dfafbdaecc45d44b -package-id transformers-0.5.6.2 -package-id transformers-compat-0.6.6-5b8dcd1799d8b869b303cd54c9e5f8e0e781d80c42b5cdde1476265310540ee2 -XHaskell2010 TextShow TextShow.Control.Applicative TextShow.Control.Concurrent TextShow.Control.Exception TextShow.Control.Monad.ST TextShow.Data.Array TextShow.Data.Bool TextShow.Data.ByteString TextShow.Data.Char TextShow.Data.Complex TextShow.Data.Data TextShow.Data.Dynamic TextShow.Data.Either TextShow.Data.Fixed TextShow.Data.Floating TextShow.Data.Functor.Compose TextShow.Data.Functor.Identity TextShow.Data.Functor.Product TextShow.Data.Functor.Sum TextShow.Debug.Trace TextShow.Debug.Trace.Generic TextShow.Debug.Trace.TH TextShow.Generic TextShow.Data.Integral TextShow.Data.List TextShow.Data.List.NonEmpty TextShow.Data.Maybe TextShow.Data.Monoid TextShow.Data.Ord TextShow.Data.Proxy TextShow.Data.Ratio TextShow.Data.Semigroup TextShow.Data.Text TextShow.Data.Tuple TextShow.Data.Typeable TextShow.Data.Version TextShow.Data.Void TextShow.Foreign.C.Types TextShow.Foreign.Ptr TextShow.Functions TextShow.GHC.Fingerprint TextShow.GHC.Generics TextShow.GHC.Stats TextShow.Numeric.Natural TextShow.System.Exit TextShow.System.IO TextShow.System.Posix.Types TextShow.Text.Read TextShow.TH TextShow.GHC.Conc.Windows TextShow.GHC.Event TextShow.GHC.TypeLits TextShow.Data.Type.Coercion TextShow.Data.Type.Equality TextShow.Data.OldTypeable TextShow.GHC.RTS.Flags TextShow.GHC.StaticPtr TextShow.GHC.Stack TextShow.Classes TextShow.Data.Typeable.Utils TextShow.FromStringTextShow TextShow.Instances TextShow.Options TextShow.TH.Internal TextShow.TH.Names TextShow.Utils -Wall -Wno-star-is-type -hide-all-packages -v3 2>&1 | tail -n 3
/home/recursion-ninja/.ghcup/bin/ghc --make -fbuilding-cabal-package -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -odir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -hidir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -stubdir /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -i -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -isrc -ishared -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen -i/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/global-autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/global-autogen -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build -Iinclude -I/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/include -optP-DNEW_FUNCTOR_CLASSES -optP-DNEW_FUNCTOR_CLASSES -optP-include -optP/home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/build/autogen/cabal_macros.h -this-unit-id text-show-3.9-inplace -hide-all-packages -Wmissing-home-modules -no-user-package-db -package-db /home/recursion-ninja/.cabal/store/ghc-9.0.1/package.db -package-db /home/recursion-ninja/Code/text-show/dist-newstyle/packagedb/ghc-9.0.1 -package-db /home/recursion-ninja/Code/text-show/dist-newstyle/build/x86_64-linux/ghc-9.0.1/text-show-3.9/package.conf.inplace -package-id array-0.5.4.0 -package-id base-4.15.0.0 -package-id base-compat-batteries-0.11.2-dc2f9df945acedea868b07c7137de52d26b56e86904a6943da4a304170856265 -package-id bifunctors-5.5.11-2a3841d53457ffc1384c87930764a68d23b0847db853b89257d3078136df7f30 -package-id bytestring-0.10.12.1 -package-id bytestring-builder-0.10.8.2.0-f1fc0db34ded57ac80a7a16014cd0244372b73c4501aa1b8f94948da8ee98daa -package-id containers-0.6.4.1 -package-id generic-deriving-1.14-60cf634e0d5e72a427899f654aec208994b91f68d01fb801568599238e6072e6 -package-id ghc-boot-th-9.0.1 -package-id ghc-prim-0.7.0 -package-id integer-gmp-1.1 -package-id template-haskell-2.17.0.0 -package-id text-1.2.4.1 -package-id th-abstraction-0.4.2.0-97bfd77d8a680b19c286c078730c0f3ae84c5d9a6ac20db1acc36cdd9250e6d4 -package-id th-lift-0.8.2-0fa84c263173fc179670fe14cfd1a7e9068a8c3619afca23dfafbdaecc45d44b -package-id transformers-0.5.6.2 -package-id transformers-compat-0.6.6-5b8dcd1799d8b869b303cd54c9e5f8e0e781d80c42b5cdde1476265310540ee2 -XHaskell2010 TextShow TextShow.Control.Applicative TextShow.Control.Concurrent TextShow.Control.Exception TextShow.Control.Monad.ST TextShow.Data.Array TextShow.Data.Bool TextShow.Data.ByteString TextShow.Data.Char TextShow.Data.Complex TextShow.Data.Data TextShow.Data.Dynamic TextShow.Data.Either TextShow.Data.Fixed TextShow.Data.Floating TextShow.Data.Functor.Compose TextShow.Data.Functor.Identity TextShow.Data.Functor.Product TextShow.Data.Functor.Sum TextShow.Debug.Trace TextShow.Debug.Trace.Generic TextShow.Debug.Trace.TH TextShow.Generic TextShow.Data.Integral TextShow.Data.List TextShow.Data.List.NonEmpty TextShow.Data.Maybe TextShow.Data.Monoid TextShow.Data.Ord TextShow.Data.Proxy TextShow.Data.Ratio TextShow.Data.Semigroup TextShow.Data.Text TextShow.Data.Tuple TextShow.Data.Typeable TextShow.Data.Version TextShow.Data.Void TextShow.Foreign.C.Types TextShow.Foreign.Ptr TextShow.Functions TextShow.GHC.Fingerprint TextShow.GHC.Generics TextShow.GHC.Stats TextShow.Numeric.Natural TextShow.System.Exit TextShow.System.IO TextShow.System.Posix.Types TextShow.Text.Read TextShow.TH TextShow.GHC.Conc.Windows TextShow.GHC.Event TextShow.GHC.TypeLits TextShow.Data.Type.Coercion TextShow.Data.Type.Equality TextShow.Data.OldTypeable TextShow.GHC.RTS.Flags TextShow.GHC.StaticPtr TextShow.GHC.Stack TextShow.Classes TextShow.Data.Typeable.Utils TextShow.FromStringTextShow TextShow.Instances TextShow.Options TextShow.TH.Internal TextShow.TH.Names TextShow.Utils -Wall -Wno-star-is-type -hide-all-packages -v3 2>&1 | tail -n 3
gcc '-fuse-ld=gold' -B/home/recursion-ninja/.cabal/store/ghc-9.0.1/unix-2.8.0.0-8276f5e709556e7c8d723731fa61d5b2aa6e8eec36238b2069b2feb47d1ad590/lib --print-file-name libpthread.so
!!! systool:linker: finished in 0.21 milliseconds, allocated 0.069 megabytes
Loading package unix-2.8.0.0 ... *** stack smashing detected ***: terminated
$ echo "Looks like it failed durong linking..."
$ echo "Lets see if the core dump was produced:"
$ ls -t | head -n 1
core
$ file core
core: ELF 64-bit LSB core file, x86-64, version 1 (SYSV), SVR4-style, from '/home/recursion-ninja/.ghcup/ghc/9.0.1/lib/ghc-9.0.1/bin/ghc -B/home/recursion-ninja/.ghcup/g', real uid: 1000, effective uid: 1000, real gid: 1000, effective gid: 1000, execfn: '/home/recursion-ninja/.ghcup/ghc/9.0.1/lib/ghc-9.0.1/bin/ghc', platform: 'x86_64'
$ gdb '/home/recursion-ninja/.ghcup/ghc/9.0.1/lib/ghc-9.0.1/bin/ghc core
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/recursion-ninja/.ghcup/ghc/9.0.1/lib/ghc-9.0.1/bin/ghc...
(No debugging symbols found in /home/recursion-ninja/.ghcup/ghc/9.0.1/lib/ghc-9.0.1/bin/ghc)
[New LWP 740319]
[New LWP 740323]
[New LWP 740320]
[New LWP 740321]
[New LWP 740322]
^CQuit
(gdb) thread apply all bt
Thread 5 (LWP 740322):
#0 0x00007f3c6a239aff in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x0000004200105c30 in ?? ()
#2 0x00000042001067b0 in ?? ()
#3 0x0000000000000002 in ?? ()
#4 0xffffffff6bacb6b0 in ?? ()
#5 0x0000000000000090 in ?? ()
#6 0x00007f3c6b4eca34 in ?? () from /home/recursion-ninja/.ghcup/ghc/9.0.1/lib/ghc-9.0.1/bin/../base-4.15.0.0/libHSbase-4.15.0.0-ghc9.0.1.so
#7 0x0000000000000000 in ?? ()
Thread 4 (LWP 740321):
#0 0x00007f3c6a2465ce in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x000000420037cc90 in ?? ()
#2 0x0000000402aa8038 in ?? ()
#3 0x0000004200106010 in ?? ()
#4 0xffffffff00000040 in ?? ()
#5 0x000000420037cab8 in ?? ()
#6 0x00007f3c6b4d8e65 in base_GHCziEventziEPoll_new10_info () from /home/recursion-ninja/.ghcup/ghc/9.0.1/lib/ghc-9.0.1/bin/../base-4.15.0.0/libHSbase-4.15.0.0-ghc9.0.1.so
#7 0x0000000000000000 in ?? ()
Thread 3 (LWP 740320):
#0 __libc_read (nbytes=8, buf=0x7f3c69a5cea8, fd=3) at ../sysdeps/unix/sysv/linux/read.c:26
#1 __libc_read (fd=fd@entry=3, buf=buf@entry=0x7f3c69a5cea8, nbytes=nbytes@entry=8) at ../sysdeps/unix/sysv/linux/read.c:24
#2 0x00007f3c6a697d6e in itimer_thread_func (_handle_tick=0x7f3c6a67f300 <handle_tick>) at rts/posix/itimer/Pthread.c:127
#3 0x00007f3c6a3a3609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#4 0x00007f3c6a246293 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x0000000000000000 in ?? ()
Thread 2 (LWP 740323):
#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xa1ebd8) at ../sysdeps/nptl/futex-internal.h:183
#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0xa1ebe0, cond=0xa1ebb0) at pthread_cond_wait.c:508
#2 __pthread_cond_wait (cond=cond@entry=0xa1ebb0, mutex=mutex@entry=0xa1ebe0) at pthread_cond_wait.c:647
#3 0x00007f3c6a697979 in waitCondition (pCond=pCond@entry=0xa1ebb0, pMut=pMut@entry=0xa1ebe0) at rts/posix/OSThreads.c:117
#4 0x00007f3c6a66d72b in waitForWorkerCapability (task=<optimized out>) at rts/Capability.c:706
#5 yieldCapability (pCap=pCap@entry=0x7f3c63ffee78, task=task@entry=0xa1eba0, gcAllowed=gcAllowed@entry=true) at rts/Capability.c:999
#6 0x00007f3c6a678973 in scheduleYield (task=0xa1eba0, pcap=0x7f3c63ffee70) at rts/Schedule.c:721
#7 schedule (initialCapability=initialCapability@entry=0x7f3c6a6c8dc0 <MainCapability>, task=task@entry=0xa1eba0) at rts/Schedule.c:317
#8 0x00007f3c6a679cbc in scheduleWorker (cap=cap@entry=0x7f3c6a6c8dc0 <MainCapability>, task=task@entry=0xa1eba0) at rts/Schedule.c:2670
#9 0x00007f3c6a6753f8 in workerStart (task=0xa1eba0) at rts/Task.c:446
#10 0x00007f3c6a3a3609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#11 0x00007f3c6a246293 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#12 0x0000000000000000 in ?? ()
Thread 1 (LWP 740319):
#0 0x00007f3c6a16a18b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x0000000000000000 in ?? ()
(gdb)
Expected behavior
The package, text-show
in this example, to build without an OS generated exception.
Environment
- GHC version used:
- 9.2-rc
- 9.0.1
- 8.10.5
- 8.8.4
- 8.6.5
- 8.4.4
- 8.2.2
- 8.0.2
- 7.10.3
Optional:
- Operating System: Ubuntu 20.04,
initrd.img-5.8.0-63-generic
- System Architecture:
x86_64
See also: #16046 (closed), a potentially relavent issue.
Note that most of this was debugged on the cabal
GitHub page for issue 7456. Viewing this issue's history may be informative.