> Hi. I have just downloaded and installed (in-place)
> ghc-4.01. I tried testing it by compiling the sample program
> 
>   main = putStr "Hello, world!\n"
> 
> with
> 
>   ghc -o hello Main.hs
> 
> This compiles without complaint (only an observation that
> "ghc: module version changed to 1; reason: no old .hi
> file"), but then running the program gives
> 
>   [jgibbons@pounamu ghc]$ ./hello
>   hello: fatal error: GetMBlock: misaligned block returned  

The system asked for some memory at a given address, and the OS returned
some memory at a different address.  This problem occurs because there's no
way to say to Linux in general "give me a chunk of memory aligned on an
N-byte boundary", so we try to guess which addresses will be free.

Looks like we got it wrong on your machine.

> I'm using linux:
> 
>   Linux pounamu.brookes.ac.uk 1.2.13 #1 Sun Feb 11 00:43:09 
> EST 1996 i586

That's a pretty old version of Linux - upgrading would probably help.

Failing that, you'll have to fiddle around with ASK_FOR_MEM_AT in
fptools/ghc/rts/MBlock.h.  Try running

        cat /proc/self/maps

to find a free chunk of memory.

Cheers,
        Simon

-- 
Simon Marlow 
Microsoft Research Ltd., Cambridge, U.K.

Reply via email to