ghc 6.10.1 on freebsd 7 amd64 - ghci problems

Simon Marlow marlowsd at gmail.com
Thu Jan 8 10:55:21 EST 2009


Markus Barenhoff wrote:
> On Thu 08.01 12:22, Simon Marlow wrote:
>> Markus Barenhoff wrote:
>>> On Mon 15.12 09:26, Simon Marlow wrote:
>>> Yesterday I updated my sources to the current darcs version. Now the build 
>>> works
>>> again, but there still seems to exist a problem with memory allocation:
>>>
>>> --- snip ---
>>> $ ghci
>>> GHCi, version 6.11.20090105: http://www.haskell.org/ghc/  :? for help
>>> ghc: mmap 28672 bytes at 0x40099000: Invalid argument
>>> ghc: Try specifying an address with +RTS -xm<addr> -RTS
>>> --- snip ---
>> Could you run ktrace or truss on ghci so we can see the offending call to 
>> mmap()?  I'm not sure what it is that the OS is complaining about.
>>
> 
> it looks like it is trying to mmap() stdin...
> 
> attached you find the complete trace.
> 
> --- snip ---
> ...
> 38437: stat("/usr/local/haskell/lib/ghc-6.11.20090105/ghc-prim-0.1.0.0/HSghc-prim-0.1.0.0.o",{ mode=-rw-r--r-- ,inode=284783,size=623896,blksize=4096 }) = 0 (0x0)
> 38437: stat("/usr/local/haskell/lib/ghc-6.11.20090105/ghc-prim-0.1.0.0/HSghc-prim-0.1.0.0.o",{ mode=-rw-r--r-- ,inode=284783,size=623896,blksize=4096 }) = 0 (0x0)
> 38437: open("/usr/local/haskell/lib/ghc-6.11.20090105/ghc-prim-0.1.0.0/HSghc-prim-0.1.0.0.o",O_RDONLY,00) = 6 (0x6)
> 38437: mmap(0x40000000,626688,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_PRIVATE,6,0x0) = 34382954496 (0x801624000)
> 38437: munmap(0x801624000,626688)                = 0 (0x0)
> 38437: mmap(0x40000000,626688,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_PRIVATE|MAP_FIXED,6,0x0) = 1073741824 (0x40000000)
> 38437: close(6)                                  = 0 (0x0)
> 38437: mmap(0x40099000,28672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_ANON,0,0x0) ERR#22 'Invalid argument'

Ah, I think I see the problem.  FreeBSD requires the fd argument to be -1 
for MAP_ANON, but Linux doesn't care which is why it didn't fail in this 
way for me.  I'll commit a patch as soon as it validates.

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list