Opened 2 months ago

Last modified 6 weeks ago

#8727 new bug

HLearn test on ubuntu Precise x64 within vagrant Box

Reported by: teuffy Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Other Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

ghc: panic! (the 'impossible' happened)

(GHC version 7.6.3 for x86_64-unknown-linux):

loadArchive "/home/vagrant/.cabal/lib/x86_64-linux-ghc-7.6.3/HLearn-2.0.0.0/libHSHLearn-2.0.0.0.a": failed

import HLearn.Algebra
import Control.DeepSeq
import HLearn.Models.Distributions
import Statistics.Distribution.Normal

dataset =  [1,2,3,4,5,6]
--dist = train dataset :: Normal Double

data Marble = Red | Green | Blue | White
    deriving (Read,Show,Eq,Ord)

simonBag :: [Marble]
simonBag = [Red, Red, Red, Green, Blue, Green, Red, Blue, Green, Green, Red, Red, Blue, Red, Red, Red, White]
simonDist = train simonBag :: Categorical Double Marble

Change History (17)

comment:1 Changed 2 months ago by teuffy

it works on osx 10.8.5 but trying to run it on a vagrant box it produced this error

comment:2 Changed 2 months ago by carter

could you try in a sandbox on the vagrant box?

comment:3 Changed 2 months ago by teuffy

Well I am quite new to haskell and not so familiar with the sanbox logic as the tuto I got didn't help.
Do you have a quick "how to do it", I mean should I install cabal-dev and what are the steps after to install HLearn and run ghci from where ?

comment:4 Changed 2 months ago by teuffy

Hi
Did with the git HLearn folder:
cabal sandbox init
cabal install --only-dependencies
took 2 hours to install

and loaded the code within ghci and got the same error message

?? any ideas

comment:5 follow-up: Changed 2 months ago by carter

does the code work when you compile it? (ie have a main = foo in the module and build it with ghc). There are certain problems with ghci (though i have no idea how it could be tripping them.)

@teuffy, could you share {{ghc --info}} and {{cabal --version}} with us please?

comment:6 in reply to: ↑ 5 Changed 2 months ago by teuffy

Replying to carter:

does the code work when you compile it? (ie have a main = foo in the module and build it with ghc). There are certain problems with ghci (though i have no idea how it could be tripping them.)

@teuffy, could you share {{ghc --info}} and {{cabal --version}} with us please?

The code works when compiled
the output ->
Categorical {pdfmap = fromList [(Red,9.0),(Green,4.0),(Blue,3.0),(White,1.0)]}

cabal --version

cabal-install version 1.18.0.2
using version 1.18.1 of the Cabal library

ghc --info

[("Project name","The Glorious Glasgow Haskell Compilation System")
,("GCC extra via C opts"," -fwrapv")
,("C compiler command","/usr/bin/gcc")
,("C compiler flags"," -fno-stack-protector -Wl,--hash-size=31 -Wl,--reduce-memory-overheads")
,("ar command","/usr/bin/ar")
,("ar flags","q")
,("ar supports at file","YES")
,("touch command","touch")
,("dllwrap command","/bin/false")
,("windres command","/bin/false")
,("perl command","/usr/bin/perl")
,("target os","OSLinux")
,("target arch","ArchX86_64")
,("target word size","8")
,("target has GNU nonexec stack","True")
,("target has .ident directive","True")
,("target has subsections via symbols","False")
,("LLVM llc command","llc")
,("LLVM opt command","opt")
,("Project version","7.6.3")
,("Booter version","7.4.1")
,("Stage","2")
,("Build platform","x86_64-unknown-linux")
,("Host platform","x86_64-unknown-linux")
,("Target platform","x86_64-unknown-linux")
,("Have interpreter","YES")
,("Object splitting supported","YES")
,("Have native code generator","YES")
,("Support SMP","YES")
,("Unregisterised","NO")
,("Tables next to code","YES")
,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn")
,("Leading underscore","NO")
,("Debug on","False")
,("LibDir?","/usr/lib/ghc")
,("Global Package DB","/usr/lib/ghc/package.conf.d")
,("Gcc Linker flags","[\"-Wl,--hash-size=31\",\"-Wl,--reduce-memory-overheads\"]")
,("Ld Linker flags","[\"--hash-size=31\",\"--reduce-memory-overheads\"]")
]

comment:7 Changed 2 months ago by teuffy

@carter
I don't know if it has an impact on ghci but on this machine I installed the haskell-framework with apt-get install (ubuntu precise) + cabal install cabal-install -> ghc 7.4 and cabal 1.18

but

for HLearn ghc 7.6 is needed so I did the following

sudo apt-get --purge remove ghc
sudo apt-get --purge remove cabal-install
sudo apt-add-repository ppa:typeful/ghc-7.6.3
sudo apt-add-repository ppa:typeful/cabal-install
sudo apt-get update
sudo apt-get install ghc cabal-install

comment:8 Changed 2 months ago by carter

@teuffy, if you could get a minimal test case that doesn't pull in all of hlearns deps, that be great

HOWEVER

I suspect that you're tripping on one of the known issues that resolved with GHC 7.8 (and HEAD) for GHCI. Also, did you file bug reports with mike before escalating to trac?

if you can get ghc 7.8 rc installed, and test your example code in ghci there, that would help narrow things down

eg

sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install cabal-install-1.18  ghc-7.8.1

then massage the libs to work on 7.8 and test there, that would help.

ALTERNATIVELY: how much space is on the vm? does it have swap space? it could be that the vm ran of memory/swap during linking in a weird way?

comment:9 Changed 2 months ago by teuffy

a - minimal test ?? what should I do exactly
as "doesn't pull in all of hlearns deps" is not clear for me. I am a newbie ...

c - memory ram 2048 MB . I haven't set the swap space (vagranfile set to 2048MB)

b - I will try to install 7.8 and keep you posted

comment:10 Changed 2 months ago by teuffy

@carter
"then massage the libs to work on 7.8 and test there, that would help." What should I do exactly here?

comment:11 Changed 2 months ago by carter

hrm? not sure i understand what you're asking. (and i'm sorry if i'm causing any confusion)

Also, have you given mike izbiki a bug report (the HLearn)? It may be a known issue he's worked around (if so, please share with us too)

comment:12 follow-up: Changed 2 months ago by teuffy

I installed ghc-7.8.1 and ghc --version still showing 7.6.3. What should I do to test my code under ghc 7.8.1?

comment:13 Changed 2 months ago by teuffy

@carter
Bug is gone within ghci after the installation of ghc 7.8.1. Many thanks for your help and support

comment:14 Changed 2 months ago by teuffy

Well .... sorry about my previous statement
but not really gone as
"loadArchive "/home/vagrant/.cabal/lib/x86_64-linux-ghc-7.6.3/HLearn-2.0.0.0/libHSHLearn-2.0.0.0.a": failed"
still showing 7.6.3

comment:15 Changed 2 months ago by carter

make sure the only ghc setup is 7.8, cabal install the hlearn deps (which may require some patches), and run the example?

but first take a break and file a bug report with the hlearn author too I think

comment:16 in reply to: ↑ 12 ; follow-up: Changed 2 months ago by hvr

Replying to teuffy:

I installed ghc-7.8.1 and ghc --version still showing 7.6.3. What should I do to test my code under ghc 7.8.1?

Fyi, when using the ppa:hvr/ghc PPAs you need to put e.g. /opt/ghc/7.8.1/bin early enough in your PATH.

comment:17 in reply to: ↑ 16 Changed 6 weeks ago by teuffy

is "ppa:hvr/ghc" still working to install ghc 7.8.1 ?

Replying to hvr:

Replying to teuffy:

I installed ghc-7.8.1 and ghc --version still showing 7.6.3. What should I do to test my code under ghc 7.8.1?

Fyi, when using the ppa:hvr/ghc PPAs you need to put e.g. /opt/ghc/7.8.1/bin early enough in your PATH.

Note: See TracTickets for help on using tickets.