[GHC] #13675: Binary.get(TyClDecl): ForeignType

#13675: Binary.get(TyClDecl): ForeignType -------------------------------------+------------------------------------- Reporter: Neidon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-unknown-linux): Binary.get(TyClDecl): ForeignType CallStack (from HasCallStack): error, called at compiler/iface/IfaceSyn.hs:1530:18 in ghc:IfaceSyn }}} Steps to reproduce: 1. Download a 640 Mb zip archive from https://drive.google.com/file/d/0B0Jnpz9ldbuHZHI4NFB3XzBucVU/view?usp=sharin.... Unpack it. Inside are two directories: * `home_stack` (`du -s` reports size 2691340 Kb) * `cardano-sl` (`du -s` reports size 639820 Kb) 2. Move `home_stack` to `~/.stack`, deleting the original directory if it exists. 3. Move `cardano-sl` to `~/repos/cardano-sl`. 4. `cd` to `~/repos/cardano-sl`. 5. Issue `stack build --flag cardano-sl:with-explorer --ghc-options -fprint-potential-instances`. (Should also reproduce with `stack build` alone, but the following output is from the longer command.) Output on my machine: {{{ Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/GcgJH7g69OEv'... remote: Counting objects: 20, done. remote: Total 20 (delta 0), reused 0 (delta 0), pack-reused 20 Unpacking objects: 100% (20/20), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/ENyDIhK06WOU'... remote: Counting objects: 1297, done. remote: Total 1297 (delta 0), reused 0 (delta 0), pack-reused 1297 Receiving objects: 100% (1297/1297), 260.82 KiB | 402.00 KiB/s, done. Resolving deltas: 100% (605/605), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/TD50yXVIvxc9'... remote: Counting objects: 1740, done. remote: Total 1740 (delta 0), reused 0 (delta 0), pack-reused 1740 Receiving objects: 100% (1740/1740), 300.55 KiB | 0 bytes/s, done. Resolving deltas: 100% (988/988), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/XNE9sXB7eSlZ'... remote: Counting objects: 782, done. remote: Total 782 (delta 0), reused 0 (delta 0), pack-reused 782 Receiving objects: 100% (782/782), 361.32 KiB | 352.00 KiB/s, done. Resolving deltas: 100% (496/496), done. Cloning into '/home/ser/repos/cardano-sl/.stack-work/downloaded/SOLx- DoyBtx1'... remote: Counting objects: 911, done. remote: Total 911 (delta 0), reused 0 (delta 0), pack-reused 911 Receiving objects: 100% (911/911), 466.06 KiB | 754.00 KiB/s, done. Resolving deltas: 100% (346/346), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/GCp_IHcTNp9P'... remote: Counting objects: 713, done. remote: Total 713 (delta 0), reused 0 (delta 0), pack-reused 713 Receiving objects: 100% (713/713), 179.48 KiB | 0 bytes/s, done. Resolving deltas: 100% (312/312), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/Lyd_i8-L91FJ'... remote: Counting objects: 161, done. remote: Total 161 (delta 0), reused 0 (delta 0), pack-reused 161 Receiving objects: 100% (161/161), 36.19 KiB | 0 bytes/s, done. Resolving deltas: 100% (82/82), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/CiIBoLUguKbQ'... remote: Counting objects: 2556, done. remote: Compressing objects: 100% (36/36), done. remote: Total 2556 (delta 7), reused 1 (delta 1), pack-reused 2518 Receiving objects: 100% (2556/2556), 678.84 KiB | 1.01 MiB/s, done. Resolving deltas: 100% (1511/1511), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/ZdBBqCDMftE9'... remote: Counting objects: 1463, done. remote: Compressing objects: 100% (13/13), done. remote: Total 1463 (delta 3), reused 0 (delta 0), pack-reused 1446 Receiving objects: 100% (1463/1463), 518.63 KiB | 975.00 KiB/s, done. Resolving deltas: 100% (585/585), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/_k2aE31sX6Xe'... remote: Counting objects: 1137, done. remote: Total 1137 (delta 0), reused 0 (delta 0), pack-reused 1137 Receiving objects: 100% (1137/1137), 210.59 KiB | 360.00 KiB/s, done. Resolving deltas: 100% (528/528), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/wSJGfkFIKfNg'... remote: Counting objects: 345, done. remote: Compressing objects: 100% (42/42), done. remote: Total 345 (delta 18), reused 0 (delta 0), pack-reused 299 Receiving objects: 100% (345/345), 136.62 KiB | 0 bytes/s, done. Resolving deltas: 100% (138/138), done. Cloning into '/home/ser/repos/cardano-sl/.stack- work/downloaded/5U2760eQdlAf'... remote: Counting objects: 2454, done. remote: Total 2454 (delta 0), reused 0 (delta 0), pack-reused 2454 Receiving objects: 100% (2454/2454), 401.41 KiB | 0 bytes/s, done. Resolving deltas: 100% (1100/1100), done. No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl" Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps. This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595 No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl-core" Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps. This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595 No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl-db" Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps. This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595 No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl-infra" Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps. This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595 No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl-lrc" Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps. This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595 No packages found in snapshot which provide a "cpphs" executable, which is a build-tool dependency of "cardano-sl-update" Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps. This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595 base58-bytestring-0.1.0: configure base58-bytestring-0.1.0: build concurrent-extra-0.7.0.10: configure base58-bytestring-0.1.0: copy/register concurrent-extra-0.7.0.10: build directory-1.3.1.0: configure concurrent-extra-0.7.0.10: copy/register directory-1.3.1.0: build cryptonite-0.22: configure cryptonite-0.22: build ed25519-0.0.5.0: configure (lib) ed25519-0.0.5.0: build (lib) network-transport-0.5.1: configure (lib) network-transport-0.5.1: build (lib) directory-1.3.1.0: copy/register Glob-0.7.14: configure ed25519-0.0.5.0: copy/register network-transport-0.5.1: copy/register Glob-0.7.14: build SHA-1.6.4.2: configure SHA-1.6.4.2: build acid-state-0.14.2: configure (lib) acid-state-0.14.2: build (lib) Glob-0.7.14: copy/register cryptonite-0.22: copy/register SHA-1.6.4.2: copy/register Progress: 9/91 -- While building package acid-state-0.14.2 using: /home/ser/.stack/setup-exe-cache/x86_64-linux/Cabal- simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack- work/dist/x86_64-linux/Cabal-1.24.2.0 build lib:acid-state --ghc-options " -ddump-hi -ddump-to-file" Process exited with code: ExitFailure 1 Logs have been written to: /home/ser/repos/cardano-sl/.stack-work/logs /acid-state-0.14.2.log Configuring acid-state-0.14.2... Preprocessing library acid-state-0.14.2... [ 1 of 15] Compiling Paths_acid_state ( .stack- work/dist/x86_64-linux/Cabal-1.24.2.0/build/autogen/Paths_acid_state.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Paths_acid_state.o ) [ 2 of 15] Compiling FileIO ( src-unix/FileIO.hs, .stack- work/dist/x86_64-linux/Cabal-1.24.2.0/build/FileIO.o ) [ 3 of 15] Compiling Data.Acid.Core ( src/Data/Acid/Core.hs, .stack- work/dist/x86_64-linux/Cabal-1.24.2.0/build/Data/Acid/Core.o ) [ 4 of 15] Compiling Data.Acid.Common ( src/Data/Acid/Common.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Data/Acid/Common.o ) /home/ser/repos/cardano-sl/.stack- work/downloaded/ENyDIhK06WOU/src/Data/Acid/Common.hs:21:1: warning: [-Wunused-imports] The import of ‘Control.Applicative’ is redundant except perhaps to import instances from ‘Control.Applicative’ To import instances alone, use: import Control.Applicative() [ 5 of 15] Compiling Data.Acid.Memory.Pure ( src/Data/Acid/Memory/Pure.hs, .stack- work/dist/x86_64-linux/Cabal-1.24.2.0/build/Data/Acid/Memory/Pure.o ) [ 6 of 15] Compiling Data.Acid.TemplateHaskell ( src/Data/Acid/TemplateHaskell.hs, .stack- work/dist/x86_64-linux/Cabal-1.24.2.0/build/Data/Acid/TemplateHaskell.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-unknown-linux): Binary.get(TyClDecl): ForeignType CallStack (from HasCallStack): error, called at compiler/iface/IfaceSyn.hs:1530:18 in ghc:IfaceSyn Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Output of `stack --version`: {{{ Version 1.3.2 x86_64 Compiled with: - Cabal-1.24.0.0 - Glob-0.7.14 - HUnit-1.5.0.0 - MonadRandom-0.5.1 - QuickCheck-2.9.2 - SHA-1.6.4.2 - StateVar-1.1.0.4 - aeson-1.0.2.1 - aeson-compat-0.3.6 - annotated-wl-pprint-0.7.0 - ansi-terminal-0.6.2.3 - ansi-wl-pprint-0.6.7.3 - array-0.5.1.1 - asn1-encoding-0.9.5 - asn1-parse-0.9.4 - asn1-types-0.3.2 - async-2.1.1 - attoparsec-0.13.1.0 - auto-update-0.1.4 - base-4.9.0.0 - base-compat-0.9.2 - base-orphans-0.5.4 - base16-bytestring-0.1.1.6 - base64-bytestring-1.0.0.1 - bifunctors-5.4.1 - binary-0.8.3.0 - binary-tagged-0.1.4.2 - bitarray-0.0.1.1 - blaze-builder-0.4.0.2 - blaze-html-0.8.1.3 - blaze-markup-0.7.1.1 - byteable-0.1.1 - bytestring-0.10.8.1 - call-stack-0.1.0 - case-insensitive-1.2.0.8 - cereal-0.5.4.0 - clock-0.7.2 - comonad-5 - conduit-1.2.9 - conduit-extra-1.1.15 - connection-0.2.7 - constraints-0.9.1 - containers-0.5.7.1 - contravariant-1.4 - cookie-0.4.2.1 - cryptohash-0.11.9 - cryptohash-conduit-0.1.1 - cryptonite-0.22 - data-default-class-0.1.2.0 - deepseq-1.4.2.0 - digest-0.0.1.2 - directory-1.2.6.2 - distributive-0.5.2 - dlist-0.8.0.2 - easy-file-0.2.1 - either-4.4.1.1 - errors-2.1.3 - exceptions-0.8.3 - extra-1.5.1 - fast-logger-2.4.10 - file-embed-0.0.10 - filelock-0.1.0.1 - filepath-1.4.1.0 - free-4.12.4 - fsnotify-0.2.1 - generic-deriving-1.11.1 - generics-sop-0.2.4.0 - ghc-boot-th-8.0.1 - ghc-prim-0.5.0.0 - gitrev-1.2.0 - hashable-1.2.5.0 - hastache-0.6.1 - hinotify-0.3.9 - hit-0.6.3 - hourglass-0.2.10 - hpack-0.16.0 - hpc-0.6.0.3 - hspec-2.4.2 - hspec-core-2.4.2 - hspec-discover-2.4.2 - hspec-expectations-0.8.2 - hspec-smallcheck-0.4.2 - http-api-data-0.3.5 - http-client-0.5.6.1 - http-client-tls-0.3.4 - http-conduit-2.2.3.1 - http-types-0.9.1 - ieee754-0.7.9 - integer-gmp-1.0.0.1 - integer-logarithms-1.0.1 - lifted-async-0.9.1.1 - lifted-base-0.2.3.10 - logict-0.6.0.2 - memory-0.14.2 - microlens-0.4.8.0 - microlens-th-0.4.1.1 - mime-types-0.1.0.7 - mmorph-1.0.9 - monad-control-1.0.1.0 - monad-logger-0.3.21 - monad-loops-0.4.3 - monad-unlift-0.2.0 - mono-traversable-1.0.2 - mtl-2.2.1 - network-2.6.3.1 - network-uri-2.6.1.0 - old-locale-1.0.0.7 - old-time-1.1.0.3 - open-browser-0.2.1.0 - optparse-applicative-0.13.2.0 - optparse-simple-0.0.3 - parsec-3.1.11 - path-0.5.12 - path-io-1.2.2 - path-pieces-0.2.1 - patience-0.1.1 - pem-0.2.2 - persistent-2.6.1 - persistent-sqlite-2.6.2 - persistent-template-2.5.2 - pid1-0.1.0.1 - prelude-extras-0.4.0.3 - pretty-1.1.3.3 - primitive-0.6.1.0 - process-1.4.2.0 - profunctors-5.2 - project-template-0.2.0 - quickcheck-io-0.1.4 - random-1.1 - regex-applicative-0.3.3 - regex-applicative-text-0.1.0.1 - resource-pool-0.2.3.2 - resourcet-1.1.9 - retry-0.7.4.2 - rts-1.0 - safe-0.3.14 - safe-exceptions-0.1.5.0 - scientific-0.3.4.10 - semigroupoids-5.1 - semigroups-0.18.2 - setenv-0.1.1.3 - silently-1.2.5 - smallcheck-1.1.1 - socks-0.5.5 - split-0.2.3.1 - stm-2.4.4.1 - stm-chans-3.0.0.4 - store-0.3.1 - store-core-0.3 - streaming-commons-0.1.17 - syb-0.6 - system-fileio-0.3.16.3 - system-filepath-0.4.13.4 - tagged-0.8.5 - tar-0.5.0.3 - template-haskell-2.11.0.0 - temporary-1.2.0.4 - text-1.2.2.1 - text-binary-0.2.1.1 - text-metrics-0.2.0 - tf-random-0.5 - th-expand-syns-0.4.2.0 - th-lift-0.7.6 - th-lift-instances-0.1.11 - th-orphans-0.13.3 - th-reify-many-0.1.6 - th-utilities-0.2.0.1 - time-1.6.0.1 - time-locale-compat-0.1.1.3 - tls-1.3.10 - transformers-0.5.2.0 - transformers-base-0.4.4 - transformers-compat-0.5.1.4 - unexceptionalio-0.3.0 - unicode-transforms-0.2.1 - unix-2.7.2.0 - unix-compat-0.4.3.1 - unix-time-0.3.7 - unordered-containers-0.2.7.2 - uri-bytestring-0.2.3.1 - utf8-string-1.0.1.1 - uuid-types-1.0.3 - vector-0.11.0.0 - vector-algorithms-0.7.0.1 - vector-binary-instances-0.2.3.4 - void-0.7.1 - x509-1.6.5 - x509-store-1.6.2 - x509-system-1.6.4 - x509-validation-1.6.5 - yaml-0.8.22 - zip-archive-0.3.0.5 - zlib-0.6.1.2 - zlib-bindings-0.1.1.5 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13675 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13675: Binary.get(TyClDecl): ForeignType -------------------------------------+------------------------------------- Reporter: Neidon | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => infoneeded Comment: I'm afraid I can't reproduce this as-is. I end up failing with missing interface files, {{{ /tmp/stack6279/cryptonite-0.22/Crypto/Number/Serialize/Internal.hs:19:1: error: Failed to load interface for ‘Data.Memory.PtrMethods’ There are files missing in the ‘memory-0.14.1’ package, try running 'ghc-pkg check'. Use -v to see a list of the files searched for. }}} Have you been able to reproduce this after wiping your `.stack` directory? I don't see how the compiler could have possibly written out the interface file in question and this is the first time I've ever seen this error. It would be nice to rule out a simple bit-flip. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13675#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13675: Binary.get(TyClDecl): ForeignType -------------------------------------+------------------------------------- Reporter: Neidon | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Neidon):
Have you been able to reproduce this after wiping your .stack directory?
No. I did `rm -rf ~/.stack`, then rebuilt the whole project from scratch `stack build --install-ghc` and the problem was gone. I've tried this just now on the same machine and I'm also getting missed interface files, albeit for a different package. {{{ /tmp/stack13960/cpphs-1.20.4/Language/Preprocessor/Cpphs/ReadFirst.hs:21:1: error: Failed to load interface for ‘System.Directory’ There are files missing in the ‘directory-1.3.1.0’ package, try running 'ghc-pkg check'. Use -v to see a list of the files searched for. }}} So I don't know how to reproduce this anymore. For future reference, it would be nice to know what I should include in the dumps of the computer's state aside from `~/.stack` and the project directory, but for now this bug should probably be closed and reopened only if someone else encounters it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13675#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13675: Binary.get(TyClDecl): ForeignType -------------------------------------+------------------------------------- Reporter: Neidon | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: worksforme | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: infoneeded => closed * resolution: => worksforme Comment: I admit that I don't use stack myself and know relatively little about how it invokes ghc. From what I do know I would have thought that `~/.stack` would be sufficient, so I was a bit surprised when your (very complete; thank you!) reproduction instructions failed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13675#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC