RE: Unregistered build (was Re: AMD64)

On 17 June 2004 16:29, Peter Robinson wrote:
Well the build finally succeeded but unfortunately I immediately get a segfault when running ghc/ghci. I've attached the output of # strace -o log ./ghc
It looks like registerised compilation on x86_64 isn't quite working yet, then. If you're up to debugging this, then I suggest you start from a simpler program - try hello world registerised, and then slightly larger programs if that works. Compile programs with -debug, and run with gdb to find out where the crash is happening. Cheers, Simon

On Thursday 17 June 2004 17:38, Simon Marlow wrote:
It looks like registerised compilation on x86_64 isn't quite working yet, then. If you're up to debugging this, then I suggest you start from a simpler program - try hello world registerised, and then slightly larger programs if that works.> Compile programs with -debug, and run with gdb to find out where the crash is happening. I would if I could, but unfortunately I can't even start ghc (the strace log I've attached before was created when running ghc without _any_ arguments): # ./ghc # Segmentation fault
By the way, the unregistered ghc does not build all programs I've tried. This was the result of trying a more complex one: # ghc-inplace --make Main.hs # Chasing modules from: Main.hs # ghc-6.2.20040613: internal error: getMBlock: mmap: Invalid argument Some other ones can be compiled but cannot be executed (like ghc). All crashes are related to memory management: #../log:mmap(0x2a96300000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a96300000 #../log:mmap(0x2a96400000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a96400000 #../log:mmap(0x2a96500000, 30739081986048, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument) #../log:write(2, "getMBlock: mmap: Invalid argumen"..., 33) = 33 Here's another trace of a different program - note that the first argument of mmap is the same when the crash occurs: #log:mmap(0x2a96300000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE| MAP_ANONYMOUS, -1, 0) = 0x2a96300000 #log:mmap(0x2a96400000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE| MAP_ANONYMOUS, -1, 0) = 0x2a96400000 #log:mmap(0x2a96500000, 11978664837120, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument) #log:write(2, "getMBlock: mmap: Invalid argumen"..., 33) = 33 And a third one: #mprotect(0, 1048264, PROT_NONE) = -1 ENOMEM (Cannot allocate memory) #... #munmap(0x2a95c4f000, 131072) = 0 #--- SIGSEGV (Segmentation fault) @ 0 (0) -- I think we are at a dead end right now but at least I've become quite familiar with building ghc :-) Cheers Peter

listener:
On Thursday 17 June 2004 17:38, Simon Marlow wrote:
It looks like registerised compilation on x86_64 isn't quite working yet, then. If you're up to debugging this, then I suggest you start from a simpler program - try hello world registerised, and then slightly larger programs if that works.> Compile programs with -debug, and run with gdb to find out where the crash is happening. I would if I could, but unfortunately I can't even start ghc (the strace log I've attached before was created when running ghc without _any_ arguments): # ./ghc # Segmentation fault
By the way, the unregistered ghc does not build all programs I've tried. This was the result of trying a more complex one: # ghc-inplace --make Main.hs # Chasing modules from: Main.hs # ghc-6.2.20040613: internal error: getMBlock: mmap: Invalid argument
Some other ones can be compiled but cannot be executed (like ghc). All crashes are related to memory management:
#../log:mmap(0x2a96300000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a96300000 #../log:mmap(0x2a96400000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a96400000 #../log:mmap(0x2a96500000, 30739081986048, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument) #../log:write(2, "getMBlock: mmap: Invalid argumen"..., 33) = 33
Here's another trace of a different program - note that the first argument of mmap is the same when the crash occurs: #log:mmap(0x2a96300000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE| MAP_ANONYMOUS, -1, 0) = 0x2a96300000 #log:mmap(0x2a96400000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE| MAP_ANONYMOUS, -1, 0) = 0x2a96400000 #log:mmap(0x2a96500000, 11978664837120, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument) #log:write(2, "getMBlock: mmap: Invalid argumen"..., 33) = 33
And a third one: #mprotect(0, 1048264, PROT_NONE) = -1 ENOMEM (Cannot allocate memory) #... #munmap(0x2a95c4f000, 131072) = 0 #--- SIGSEGV (Segmentation fault) @ 0 (0) --
I think we are at a dead end right now but at least I've become quite familiar with building ghc :-)
That's interesting. GHC unregisterised on amd64/openbsd *does* pass all the testsuite tests. -- Don

2004-06-18T01:57:14 Donald Bruce Stewart:
That's interesting. GHC unregisterised on amd64/openbsd *does* pass all the testsuite tests.
Which brings us around to the question that opened this thread, is there any way to install the unregistered build? Thanks, -Bennett

bet:
2004-06-18T01:57:14 Donald Bruce Stewart:
That's interesting. GHC unregisterised on amd64/openbsd *does* pass all the testsuite tests.
Which brings us around to the question that opened this thread, is there any way to install the unregistered build?
Yes. Download and build the src, and 'make install' :-) For some platforms unregistered builds are even being distributed in the native package format, openbsd/amd64 for one, and Ian Lynagh has a *bunch* of Debian platforms running unregisterised GHC. -- Don

2004-06-18T13:39:38 Donald Bruce Stewart:
Yes. Download and build the src, and 'make install' :-)
Thanks --- turns out my problem was that something in my env breaks the makefile, Simon gave me what I hope is the voodoo to get it to work. -Bennett

Alas, still no joy.
This sequence:
tar xjf ghc-6.2.1-src.tar.bz2
tar xzf ghc-6.2.1-i386-unknown-linux-hc.tar.gz
cd ghc-6.2.1
./configure --enable-hc-boot --enable-hc-boot-unregisterised --prefix=/usr
./distrib/hc-build --enable-hc-boot-unregisterised --prefix=/usr
make ProjectsThatExist="glafp-utils ghc libraries hslibs" prefix=$BPM_ROOT/usr install install-docs
failed in the last step with
------------------------------------------------------------------------
==fptools== make install -wr;
in /var/tmp/bpmbuild.5839/build/ghc-6.2.1/ghc/compiler
------------------------------------------------------------------------
../../ghc/compiler/stage1/ghc-inplace -H16m -O -istage2/utils -istage2/basicTypes -istage2/types -istage2/hsSyn -istage2/prelude -istage2/rename -istage2/typecheck -istage2/deSugar -istage2/coreSyn -istage2/specialise -istage2/simplCore -istage2/stranal -istage2/stgSyn -istage2/simplStg -istage2/codeGen -istage2/absCSyn -istage2/main -istage2/profiling -istage2/parser -istage2/cprAnalysis -istage2/compMan -istage2/ndpFlatten -istage2/cbits -DOMIT_NATIVE_CODEGEN -cpp -fglasgow-exts -Rghc-timing -I. -IcodeGen -InativeGen -Iparser -recomp -Rghc-timing -H16M '-#include "hschooks.h"' -c absCSyn/AbsCSyn.lhs -o stage2/absCSyn/AbsCSyn.o -ohi stage2/absCSyn/AbsCSyn.hi
ghc-6.2.1: error: directory portion of "stage2/absCSyn/AbsCSyn.o" does not exist (used with "-o" option.)
<

On Friday 18 June 2004 15:39, Donald Bruce Stewart wrote:
bet:
Which brings us around to the question that opened this thread, is there any way to install the unregistered build?
Yes. Download and build the src, and 'make install' :-)
For some platforms unregistered builds are even being distributed in the native package format, openbsd/amd64 for one, and Ian Lynagh has a *bunch* of Debian platforms running unregisterised GHC.
If you mean ftp://debian-amd64.alioth.debian.org/pub/debian-amd64/pure64/pool/main/g/ghc6/ghc6_6.2.1-2_amd64.deb this does build hello-world but fails on every other reasonable program I've tried it with (internal error: getMBlock: mmap: Invalid argument). And if the compilation should succeed the compiled program won't run (segfault because of mmap() or munmap()). It's exactly the same problem with my home made build so I don't think it's of much use at the moment. Cheers Peter

listener:
On Friday 18 June 2004 15:39, Donald Bruce Stewart wrote:
bet:
Which brings us around to the question that opened this thread, is there any way to install the unregistered build?
Yes. Download and build the src, and 'make install' :-)
For some platforms unregistered builds are even being distributed in the native package format, openbsd/amd64 for one, and Ian Lynagh has a *bunch* of Debian platforms running unregisterised GHC.
If you mean ftp://debian-amd64.alioth.debian.org/pub/debian-amd64/pure64/pool/main/g/ghc6/ghc6_6.2.1-2_amd64.deb
I was thinking more of the other weird unregisterised Debian archs GHC is built for.
this does build hello-world but fails on every other reasonable program I've tried it with (internal error: getMBlock: mmap: Invalid argument). And if the compilation should succeed the compiled program won't run (segfault because of mmap() or munmap()).
Sounds like the behaviour of the amd64 *registerised* build, not an unregisterised one?
It's exactly the same problem with my home made build so I don't think it's of much use at the moment.
*sigh* openbsd/amd64 runs fine, and the Haskell ports on this arch (darcs, alex, happy..) all work. SimonM built a working amd64-linux build about a year ago, so it does run on linux. Someone needs to dive in and debug this for linux, because the above problem isn't a limitation of the amd64 GHC port, but something linux specific. <bsd>or you could switch to a different OS ;)</bsd> -- Don
participants (4)
-
Bennett Todd
-
dons@cse.unsw.edu.au
-
Peter Robinson
-
Simon Marlow