doctests: mmap 131072 bytes at (nil): Cannot allocate memorydoctests: Try specifying an address with +RTS -xm<addr> -RTSdoctests: internal error: m32_allocator_init: Failed to map (GHC version 8.10.3 for x86_64_unknown_linux) Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
On Mac there is also a failure, but it is very different:
doctests: lookupSymbol failed in relocateSection (relocate external)/Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.a: unknown symbol `__ZNK17double_conversion23DoubleToStringConverter11ToPrecisionEdiPNS_13StringBuilderE'GHC runtime linker: fatal error: I found a duplicate definition for symbol __ZNK17double_conversion6VectorIcEixEiwhilst processing object file /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.aThe symbol was previously defined in /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.a(hs-double-conversion.o)This could be caused by: * Loading two different object files which export the same symbol * Specifying the same object file twice on the GHCi command line * An incorrect `package.conf' entry, causing some object to be loaded twice.doctests: lookupSymbol failed in relocateSection (relocate external)/Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.a: unknown symbol `__ZN17double_conversion6StrtofENS_6VectorIKcEEi'GHC runtime linker: fatal error: I found a duplicate definition for symbol __ZN17double_conversion7BitCastIdyEET_RKT0_whilst processing object file /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.aThe symbol was previously defined in /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.a(double-conversion.o)This could be caused by: * Loading two different object files which export the same symbol * Specifying the same object file twice on the GHCi command line * An incorrect `package.conf' entry, causing some object to be loaded twice.GHC runtime linker: fatal error: I found a duplicate definition for symbol __ZN17double_conversion6Bignum9LessEqualERKS0_S2_whilst processing object file /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.aThe symbol was previously defined in /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.a(bignum-dtoa.o)This could be caused by: * Loading two different object files which export the same symbol * Specifying the same object file twice on the GHCi command line * An incorrect `package.conf' entry, causing some object to be loaded twice.GHC runtime linker: fatal error: I found a duplicate definition for symbol __ZN17double_conversion7BitCastIdyEET_RKT0_whilst processing object file /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.aThe symbol was previously defined in /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.a(double-conversion.o)This could be caused by: * Loading two different object files which export the same symbol * Specifying the same object file twice on the GHCi command line * An incorrect `package.conf' entry, causing some object to be loaded twice.doctests: Could not load Object Code /Users/runner/.cabal/store/ghc-8.10.4/dbl-cnvrsn-2.0.2.0-2cca6009/lib/libHSdbl-cnvrsn-2.0.2.0-2cca6009.a(fast-dtoa.o).doctests: doctests: unable to load package `double-conversion-2.0.2.0'
I have tried to reproduce this with d35b2d629e44649927083a395f00bc3721a39621 (since the cited commit appears to be no longer available). Unfortunately, it appears not to build, failing with overlapping instances between ListLike and utf8-string:
[13 of 21] Compiling Data.ListLike.UTF8 ( src/Data/ListLike/UTF8.hs, dist/build/Data/ListLike/UTF8.o, dist/build/Data/ListLike/UTF8.dyn_o )src/Data/ListLike/UTF8.hs:153:10: error: • Overlapping instances for IsString (UTF8 BSC.ByteString) arising from the superclasses of an instance declaration Matching instances: instance UTF8.UTF8Bytes string index => IsString (UTF8 string) -- Defined in ‘Data.String.UTF8’ instance IsString (UTF8 BSC.ByteString) -- Defined at src/Data/ListLike/UTF8.hs:150:10 • In the instance declaration for ‘StringLike (UTF8 BSC.ByteString)’ |153 | instance StringLike (UTF8 BS.ByteString) where | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^src/Data/ListLike/UTF8.hs:277:10: error: • Overlapping instances for IsString (UTF8 BSLC.ByteString) arising from the superclasses of an instance declaration Matching instances: instance UTF8.UTF8Bytes string index => IsString (UTF8 string) -- Defined in ‘Data.String.UTF8’ instance IsString (UTF8 BSLC.ByteString) -- Defined at src/Data/ListLike/UTF8.hs:274:10 • In the instance declaration for ‘StringLike (UTF8 BSLC.ByteString)’ |277 | instance StringLike (UTF8 BSL.ByteString) where | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I suspect we will need to add further debug output to this failure message to get any traction on debugging it. This sort of error can arise from many failure modes and without knowing more about the state of the address space it is very hard to say which is responsible.
Hi. I now spent some hours on this (*) , and give up because of a Heisenbug feeling. E.g., the behaviour changes after stack clean, and stack test is different from running the test from stack exec -- ghci ....
So, I'm not sure whether I am debugging ghci, cabal, stack, or hint.
For my application, it seems that stack testdoes work in our CI setting, and that's enough for the moment.
@bgamari, I can reproduce this bug 100% cases when use Haskell interpreter with hint and ghc-8.10.4 on Linux, though there is no bug on MacOS BigSur. The bug appears after nixpkgs channel upgrade from release-20.09 to release-21.05. If I set -xm with something bug disappears (e.g. -xm50 or -xm100). I realized, I cannot set default -xm with -with-rtsopts.
This is a rather tricky bug since it's dependent upon how the operating system decides to layout our requested memory mappings. For what it's worth, I merged quite a few cleanups of the m32 allocator in 9.0 (!4497 (closed), !2033 (closed), !5567 (closed)) which aren't present in %8.10.4 (or any 8.10, for that matter). Perhaps it would be worth backporting these.