Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Failure - eta: panic! (the 'impossible' happened) (Eta version 0.0.5): #184

Closed
Hondough opened this issue Jan 18, 2017 · 27 comments
Closed

Comments

@Hondough
Copy link

[1 of 5] Compiling GHC.Types ( GHC/Types.hs, dist/build/GHC/Types.jar )
eta: panic! (the 'impossible' happened)
(Eta version 0.0.5):
Parsing of archive structure failed:
Cannot locate end of central directory
in "/home/john/eta/eta/libraries/ghc-prim/dist/build/GHC/Types.jar"

Please report this as a Eta bug: http://github.org/typelead/eta/issues

Failed to install ghc-prim-0.4.0.0
epm: Error: some packages failed to install:
ghc-prim-0.4.0.0 failed during the building phase. The exception was:
ExitFailure 1
Error when running Shake build system:

  • install
    user error (Development.Shake.cmd, system command failed
    Command: epm install --solver=topdown
    Current directory: /home/john/eta/eta/libraries/ghc-prim
    Exit code: 1
    Stderr:
    eta: panic! (the 'impossible' happened)
    (Eta version 0.0.5):
    Parsing of archive structure failed:
    Cannot locate end of central directory
    in "/home/john/eta/eta/libraries/ghc-prim/dist/build/GHC/Types.jar"

Please report this as a Eta bug: http://github.org/typelead/eta/issues

epm: Error: some packages failed to install:
ghc-prim-0.4.0.0 failed during the building phase. The exception was:
ExitFailure 1
)

@rahulmutt
Copy link
Member

This is the exact bug that's plaguing some Windows systems right now and we haven't had a repro on other platforms yet, awesome! From the looks of it you're on Linux. Hopefully this repro will give me enough info to fix this bug once and for all.

Please give me the specs of your system, like exact OS and the versions of zip libraries installed?

@Hondough
Copy link
Author

Which zip libraries do you need versions for? I'm not sure how to gather that info. I update through synaptic package manager daily so I hope they are fairly current.

john@Fetisov ~/eta/eta $ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 17.3 Rosa
Release: 17.3
Codename: rosa


Linux Kernel 3.16.0-38-generic


32 bit system

@rahulmutt
Copy link
Member

32-bit system? I wonder if that's the reason. To confirm, can you follow these steps?

git clone https://github.com/rahulmutt/zip-bench
cd zip-bench
stack build && stack exec zip-bench

I need you to:

  1. Share the output after executing the steps above.
  2. This program should generate a file called Test.jar, please make attempt to extract it and let me know what happens.

@Hondough
Copy link
Author

john@Fetisov ~/Projects/eta/testZip $ git clone https://github.com/rahulmutt/zip-benchCloning into 'zip-bench'...
remote: Counting objects: 21, done.
remote: Total 21 (delta 0), reused 0 (delta 0), pack-reused 21
Unpacking objects: 100% (21/21), done.
Checking connectivity... done.

@Hondough
Copy link
Author

john@Fetisov ~/Projects/eta/testZip $ cd zip-bench
john@Fetisov ~/Projects/eta/testZip/zip-bench $

@rahulmutt
Copy link
Member

What was the output of stack build && stack exec zip-bench?

@Hondough
Copy link
Author

That was still running. . . .

john@Fetisov ~/Projects/eta/testZip/zip-bench $ stack build && stack exec zip-bench
mmorph-1.0.6: using precompiled package
syb-0.6: using precompiled package
resourcet-1.1.8.1: using precompiled package
conduit-1.2.8: using precompiled package
conduit-extra-1.1.15: configure
aeson-0.11.2.1: download
conduit-extra-1.1.15: build
aeson-0.11.2.1: configure
aeson-0.11.2.1: build
conduit-extra-1.1.15: copy/register
bzlib-conduit-0.2.1.4: configure
bzlib-conduit-0.2.1.4: build
bzlib-conduit-0.2.1.4: copy/register
aeson-0.11.2.1: copy/register
path-0.5.11: configure
path-0.5.11: build
path-0.5.11: copy/register
path-io-1.1.0: configure
path-io-1.1.0: build
path-io-1.1.0: copy/register
plan-b-0.2.0: configure
plan-b-0.2.0: build
plan-b-0.2.0: copy/register
zip-0.1.3: configure
zip-0.1.3: build
zip-0.1.3: copy/register
zip-bench-0.1.0.0: configure (exe)
Configuring zip-bench-0.1.0.0...
zip-bench-0.1.0.0: build (exe)
Preprocessing executable 'zip-bench' for zip-bench-0.1.0.0...
[1 of 1] Compiling Main ( src/Main.hs, .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/zip-bench/zip-bench-tmp/Main.o )
Linking .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/zip-bench/zip-bench ...
zip-bench-0.1.0.0: copy/register
Installing executable(s) in
/home/john/Projects/eta/testZip/zip-bench/.stack-work/install/i386-linux/lts-6.27/7.10.3/bin
Completed 12 action(s).
"hello-world.txt"
john@Fetisov ~/Projects/eta/testZip/zip-bench $

@Hondough
Copy link
Author

and here is the before and after of the extraction:

john@Fetisov ~/Projects/eta/testZip/zip-bench $ ls
LICENSE merge.sh README.md Setup.hs src stack.yaml Test.jar zip-bench.cabal
john@Fetisov ~/Projects/eta/testZip/zip-bench $ jar xf Test.jar
john@Fetisov ~/Projects/eta/testZip/zip-bench $ ls
hello-world.txt LICENSE merge.sh README.md Setup.hs src stack.yaml Test.jar zip-bench.cabal
john@Fetisov ~/Projects/eta/testZip/zip-bench $

@rahulmutt
Copy link
Member

In your eta clone, can you cd into libraries/ghc-prim and run the following command:

epm install --solver=topdown -v

and share the output?

@Hondough
Copy link
Author

john@Fetisov ~/eta/eta/libraries/ghc-prim $ epm install --solver=topdown -v
/usr/bin/alex --version
/home/john/.cabal/bin/cpphs --version
/usr/bin/gcc -dumpversion
/usr/bin/ghc --numeric-version
/usr/bin/ghc-pkg --version
/usr/bin/git --version
/usr/bin/haddock --version
/usr/bin/happy --version
/usr/bin/hpc version
/usr/bin/hsc2hs --version
/home/john/.cabal/bin/HsColour -version
/usr/bin/pkg-config --version
/bin/tar --help
Reading available packages...
Resolving dependencies...
Ready to install ghc-prim-0.4.0.0
Waiting for install task to finish...
Configuring ghc-prim-0.4.0.0...
Dependency rts ==0.1.0.0: using rts-0.1.0.0
Using Cabal-1.22.8.0 compiled by ghc-7.10
Using compiler: eta-0.0.5
Using install prefix: /home/john/.epm
Binaries installed in: /home/john/.epm/bin
Libraries installed in:
/home/john/.epm/lib/i386-linux-eta-0.0.5-ghc7_10_3/ghc-prim-0.4.0.0
Private binaries installed in: /home/john/.epm/libexec
Data files installed in:
/home/john/.epm/share/i386-linux-eta-0.0.5-ghc7_10_3/ghc-prim-0.4.0.0
Documentation installed in:
/home/john/.epm/share/doc/i386-linux-eta-0.0.5-ghc7_10_3/ghc-prim-0.4.0.0
Configuration files installed in: /home/john/.epm/etc
Using alex version 3.1.0 found on system at: /usr/bin/alex
Using ar found on system at: /usr/bin/ar
No c2hs found
Using coursier version 1.0.0.15 found on system at:
/home/john/.local/bin/coursier
Using cpphs version 1.19.3 found on system at: /home/john/.cabal/bin/cpphs
Using eta version 0.0.5 found on system at: /home/john/.local/bin/eta
Using eta-pkg version 0.0.5 found on system at: /home/john/.local/bin/eta-pkg
Using gcc version 4.8 found on system at: /usr/bin/gcc
Using ghc version 7.6.3 found on system at: /usr/bin/ghc
Using ghc-pkg version 7.6.3 found on system at: /usr/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
Using git version 1.9.1 found on system at: /usr/bin/git
No greencard found
Using haddock version 2.13.2 found on system at: /usr/bin/haddock
Using happy version 1.19.0 found on system at: /usr/bin/happy
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.6 found on system at: /usr/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/bin/hsc2hs
Using hscolour version 1.22 found on system at: /home/john/.cabal/bin/HsColour
Using java version 1.8.0.102 found on system at: /usr/bin/java
Using javac version 1.8.0.102 found on system at: /usr/bin/javac
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
Using pkg-config version 0.26 found on system at: /usr/bin/pkg-config
Using strip version 2.24 found on system at: /usr/bin/strip
Using tar found on system at: /bin/tar
No uhc found
Component build order: library
creating dist/build
creating dist/build/autogen
Building ghc-prim-0.4.0.0...
/home/john/.local/bin/eta-pkg init dist/package.conf.inplace
Preprocessing library ghc-prim-0.4.0.0...
Building library...
creating dist/build
/home/john/.local/bin/eta --make -staticlib -fbuilding-cabal-package -O -outputdir dist/build -odir dist/build -hidir dist/build -stubdir dist/build -i -idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -package-name ghc-prim-0.4.0.0 -hide-all-packages -package-db dist/package.conf.inplace -package-id rts-0.1.0.0-dd60ce55e5e6e7d613c6ae1fe388a75d -XHaskell2010 GHC.CString GHC.Classes GHC.Magic GHC.Tuple GHC.Types -o dist/build/HSghc-prim-0.4.0.0.jar -this-package-key ghc-prim -pgmjavac /usr/bin/javac
[2 of 5] Compiling GHC.Tuple ( GHC/Tuple.hs, dist/build/GHC/Tuple.jar )
eta: panic! (the 'impossible' happened)
(Eta version 0.0.5):
Parsing of archive structure failed:
Cannot locate end of central directory
in "/home/john/eta/eta/libraries/ghc-prim/dist/build/GHC/Tuple.jar"

Please report this as a Eta bug: http://github.org/typelead/eta/issues

Failed to install ghc-prim-0.4.0.0
epm: Error: some packages failed to install:
ghc-prim-0.4.0.0 failed during the building phase. The exception was:
ExitFailure 1
john@Fetisov ~/eta/eta/libraries/ghc-prim $

@rahulmutt
Copy link
Member

Can you try extracting /home/john/eta/eta/libraries/ghc-prim/dist/build/GHC/Tuple.jar? And also what size is that file?

@Hondough
Copy link
Author

extracting didn't give me an error, but it didn't extract anything either. . .

john@Fetisov ~/Projects/eta/testZip/extractTest $ jar xf Tuple.jar
john@Fetisov ~/Projects/eta/testZip/extractTest $ ls
Tuple.jar

@Hondough
Copy link
Author

size of Tuple.jar is
98 bytes

@rahulmutt
Copy link
Member

rahulmutt commented Jan 18, 2017

Well that's interesting. Tuple.jar should be much larger. Can you do a hex dump?

xxd -p Tuple.jar

@Hondough
Copy link
Author

john@Fetisov ~/Projects/eta/testZip/extractTest $ xxd -p Tuple.jar
504b06062c000000000000002e002d000000000000000000000000000000
0000000000000000000000000000000000000000000000000000504b0607
00000000000000000000000001000000504b05060000000000000000ffff
ffff000000000000

@Hondough
Copy link
Author

This is the problem. Now we just need to learn the how and why.

@rahulmutt
Copy link
Member

@Hondough Would you mind coming on Gitter or Slack? It'll make debugging a bit easier.

@Hondough
Copy link
Author

I cannot right now as I need to go to my day job. We'll need to schedule a time.

@rahulmutt
Copy link
Member

rahulmutt commented Jan 18, 2017

@Hondough No problem then, we can continue here. Thanks for your patience! That should be enough info to work with.

@rahulmutt
Copy link
Member

Can you share the entire contents (recursively) of /home/john/eta/eta/libraries/ghc-prim/dist/. Just need a list of files + all file sizes. I think ls -alR /home/john/eta/eta/libraries/ghc-prim/dist/ should do the trick.

@Hondough
Copy link
Author

john@Fetisov ~/eta/eta/libraries/ghc-prim/dist $ ls -alR /home/john/eta/eta/libraries/ghc-prim/dist/
/home/john/eta/eta/libraries/ghc-prim/dist/:
total 36
drwxr-xr-x 4 john john 4096 Jan 17 22:25 .
drwxr-xr-x 4 john john 4096 Jan 17 19:06 ..
drwxr-xr-x 4 john john 4096 Jan 17 19:06 build
drwxr-xr-x 2 john john 4096 Jan 17 22:25 package.conf.inplace
-rw-r--r-- 1 john john 19260 Jan 17 22:25 setup-config

/home/john/eta/eta/libraries/ghc-prim/dist/build:
total 16
drwxr-xr-x 4 john john 4096 Jan 17 19:06 .
drwxr-xr-x 4 john john 4096 Jan 17 22:25 ..
drwxr-xr-x 2 john john 4096 Jan 17 22:25 autogen
drwxr-xr-x 2 john john 4096 Jan 17 22:25 GHC

/home/john/eta/eta/libraries/ghc-prim/dist/build/autogen:
total 20
drwxr-xr-x 2 john john 4096 Jan 17 22:25 .
drwxr-xr-x 4 john john 4096 Jan 17 19:06 ..
-rw-r--r-- 1 john john 4338 Jan 17 22:25 cabal_macros.h
-rw-r--r-- 1 john john 1314 Jan 17 19:06 Paths_ghc_prim.hs

/home/john/eta/eta/libraries/ghc-prim/dist/build/GHC:
total 24
drwxr-xr-x 2 john john 4096 Jan 17 22:25 .
drwxr-xr-x 4 john john 4096 Jan 17 19:06 ..
-rw-r--r-- 1 john john 1073 Jan 17 22:25 Tuple.hi
-rw-r--r-- 1 john john 98 Jan 17 22:25 Tuple.jar
-rw-r--r-- 1 john john 1318 Jan 17 19:06 Types.hi
-rw-r--r-- 1 john john 98 Jan 17 19:06 Types.jar

/home/john/eta/eta/libraries/ghc-prim/dist/package.conf.inplace:
total 12
drwxr-xr-x 2 john john 4096 Jan 17 22:25 .
drwxr-xr-x 4 john john 4096 Jan 17 22:25 ..
-rw-r--r-- 1 john john 40 Jan 17 22:25 package.cache
john@Fetisov ~/eta/eta/libraries/ghc-prim/dist $

@rahulmutt
Copy link
Member

Thanks! It looks like Tuple.hi was generated properly, it's the same size as in my installation. So the problem is somewhere in the codegen. Can you output the trace of the codegen?

Go to libraries/ghc-prim and run the following command:

epm install --solver=topdown -v3 > ghc-prim-build-log.txt

And can you upload that log somewhere and share? It might take some time because it dumps quite a bit.

@Hondough
Copy link
Author

It failed quickly.

ghc-prim-build-log.txt

@Hondough
Copy link
Author

and here's console:

john@Fetisov ~/eta/eta/libraries/ghc-prim $ epm install --solver=topdown -v3 > ghc-prim-build-log.txt
The Eta programming language compiler, Version 0.0.5 booted by GHC version 7.10.3
Using binary package database: /home/john/.eta/package.conf.d/package.cache
Using binary package database: dist/package.conf.inplace/package.cache
wired-in package ghc-prim not found.
wired-in package integer not found.
wired-in package base not found.
wired-in package rts mapped to rts-0.1.0.0-dd60ce55e5e6e7d613c6ae1fe388a75d
wired-in package template-haskell not found.
wired-in package ghc not found.
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags:
wired-in package ghc-prim not found.
wired-in package integer not found.
wired-in package base not found.
wired-in package rts mapped to rts-0.1.0.0-dd60ce55e5e6e7d613c6ae1fe388a75d
wired-in package template-haskell not found.
wired-in package ghc not found.
wired-in package dph-seq not found.
wired-in package dph-par not found.
*** Chasing dependencies:
Chasing modules from: *GHC.CString,*GHC.Classes,*GHC.Magic,*GHC.Tuple,*GHC.Types
Stable obj: [GHC.Types, GHC.Tuple]
Stable BCO: []
Ready for upsweep
[NONREC
ModSummary {
ms_hs_date = 2017-01-17 22:59:48.819273256 UTC
ms_mod = GHC.Tuple,
ms_textual_imps = []
ms_srcimps = []
},
NONREC
ModSummary {
ms_hs_date = 2017-01-17 22:59:48.819273256 UTC
ms_mod = GHC.Types,
ms_textual_imps = []
ms_srcimps = []
},
NONREC
ModSummary {
ms_hs_date = 2017-01-17 22:59:48.819273256 UTC
ms_mod = GHC.Magic,
ms_textual_imps = []
ms_srcimps = []
},
NONREC
ModSummary {
ms_hs_date = 2017-01-17 22:59:48.815273236 UTC
ms_mod = GHC.Classes,
ms_textual_imps = [import GHC.Types, import GHC.Tuple,
import GHC.Magic ()]
ms_srcimps = []
},
NONREC
ModSummary {
ms_hs_date = 2017-01-17 22:59:48.815273236 UTC
ms_mod = GHC.CString,
ms_textual_imps = [import GHC.Types]
ms_srcimps = []
}]
*** Deleting temp files:
Deleting:
compile: input file ./GHC/Tuple.hs
Created temporary directory: /tmp/ghc4332_0
*** Checking old interface for GHC.Tuple:
*** Deleting temp files:
Deleting: /tmp/ghc4332_0/ghc_1.s
Warning: deleting non-existent /tmp/ghc4332_0/ghc_1.s
compile: input file ./GHC/Types.hs
*** Checking old interface for GHC.Types:
*** Deleting temp files:
Deleting: /tmp/ghc4332_0/ghc_2.s
Warning: deleting non-existent /tmp/ghc4332_0/ghc_2.s
compile: input file ./GHC/Magic.hs
*** Checking old interface for GHC.Magic:
*** Parser:
*** Renamer/typechecker:
*** Desugar:
Result size of Desugar (after optimization)
= {terms: 13, types: 20, coercions: 0}
*** Simplifier:
Result size of Simplifier = {terms: 13, types: 20, coercions: 0}
*** Specialise:
Result size of Specialise = {terms: 13, types: 20, coercions: 0}
*** Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = False}):
Result size of Float out(FOS {Lam = Just 0,
Consts = True,
OverSatApps = False})
= {terms: 13, types: 20, coercions: 0}
*** Simplifier:
Result size of Simplifier = {terms: 13, types: 20, coercions: 0}
*** Simplifier:
Result size of Simplifier = {terms: 13, types: 20, coercions: 0}
*** Simplifier:
Result size of Simplifier = {terms: 13, types: 20, coercions: 0}
*** Float inwards:
Result size of Float inwards = {terms: 13, types: 20, coercions: 0}
*** Called arity analysis:
Result size of Called arity analysis
= {terms: 13, types: 20, coercions: 0}
*** Simplifier:
Result size of Simplifier = {terms: 13, types: 20, coercions: 0}
*** Demand analysis:
Result size of Demand analysis
= {terms: 13, types: 20, coercions: 0}
*** Worker Wrapper binds:
Result size of Worker Wrapper binds
= {terms: 13, types: 20, coercions: 0}
*** Simplifier:
Result size of Simplifier = {terms: 13, types: 20, coercions: 0}
*** Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = True}):
Result size of Float out(FOS {Lam = Just 0,
Consts = True,
OverSatApps = True})
= {terms: 13, types: 20, coercions: 0}
*** Common sub-expression:
Result size of Common sub-expression
= {terms: 13, types: 20, coercions: 0}
*** Float inwards:
Result size of Float inwards = {terms: 13, types: 20, coercions: 0}
*** Simplifier:
Result size of Simplifier = {terms: 13, types: 20, coercions: 0}
*** Tidy Core:
Result size of Tidy Core = {terms: 13, types: 20, coercions: 0}
writeBinIface: 0 Names
writeBinIface: 5 dict entries
*** CorePrep:
Result size of CorePrep = {terms: 13, types: 20, coercions: 0}
*** Stg2Stg:
*** Deleting temp files:
Deleting: /tmp/ghc4332_0/ghc_3.s
Warning: deleting non-existent /tmp/ghc4332_0/ghc_3.s
*** Deleting temp dirs:
Deleting: /tmp/ghc4332_0
eta: panic! (the 'impossible' happened)
(Eta version 0.0.5):
Parsing of archive structure failed:
Cannot locate end of central directory
in "/home/john/eta/eta/libraries/ghc-prim/dist/build/GHC/Magic.jar"

Please report this as a Eta bug: http://github.org/typelead/eta/issues

epm: Error: some packages failed to install:
ghc-prim-0.4.0.0 failed during the building phase. The exception was:
ExitFailure 1

@rahulmutt
Copy link
Member

Closed by mistake

@rahulmutt rahulmutt reopened this Jan 28, 2017
@rahulmutt
Copy link
Member

@Hondough This was an issue in the zip library that recently got fixed. Can you run ./update.sh and let me know if it's fixed?

@Hondough
Copy link
Author

I ran the update and it completed w/o errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants