Ticket #4214 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

OSX 64bit: ghci: loadObj internal error

Reported by: akborder Owned by:
Priority: high Milestone: 7.0.2
Component: Compiler Version: 6.12.3
Keywords: Cc: pho@…
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: GHCi crash Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

When I run ghci, it crashes with the following error message:

GHCi, version 6.12.3: http://www.haskell.org/ghc/  :? for help
ghc: internal error: loadObj: failed to mmap() memory below 2Gb; asked for 724992 bytes at 0x40000000.  Try specifying an address with +RTS -xm<addr> -RTS
    (GHC version 6.12.3 for x86_64_apple_darwin)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Abort trap

System info:

$ uname -a
Darwin mbook.localhost 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386 i386 MacBookPro3,1 Darwin
$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)

I compiled ghc-6.12.3 from sources using ghc-6.10.4 (MacPorts?) for bootstrap.

Change History

Changed 3 years ago by igloo

  • owner set to igloo
  • priority changed from normal to high
  • milestone set to 6.14.1

I have some partial patches to push related to this.

Changed 3 years ago by PHO

  • cc pho@… added

Changed 3 years ago by igloo

  • owner igloo deleted
  • summary changed from ghci: loadObj internal error to OSX 64bit: ghci: loadObj internal error

I've pushed this:

Thu Aug  5 05:06:00 PDT 2010  Ian Lynagh <igloo@earth.li>
  * On amd64/OSX we don't need to be given memory in the first 31bits
  as PIC is always on

GHCi probably still won't work (I think I got a segfault or similar) but it should be closer now.

Changed 3 years ago by igloo

  • milestone changed from 6.14.1 to 6.14.2

It'll be easier to look into this once we have bootstrapped a 6.14.1 bindist.

Changed 3 years ago by gwright

The immediate problem here is likely that 6.12.3 doesn't adjust the size of pagezero, so all references to memory below 2GB are invalid and mmap will refuse to map any memory into the requested range. The quick fix is to add

#if defined(darwin_HOST_OS) && defined(x86_64_HOST_ARCH)
        , "-pagezero_size", "0x1000"
#endif

to the bottom of rts/package.conf.in. In my tests, this fixes a lot of the failing ghci tests (about 600). Many tests still fail with other crashes after thing addition, however.

Changed 2 years ago by simonpj

This bug relates OSX 64-bit. Currently Greg has built bindists for OSX 64 bit for GHC 7.0, but they only work on Version 10.6 of OSX. We think he'll soon have a version for 10.5. We only have 10.5, so that will mean we can build on OSX 64.

Changed 2 years ago by maeder

Darwin Kernel Version 10.4.0 corresponds to Mac OS X v10.6.4 (Snow Leopard) I do not think, that the minor version "4" matters. The bindists from http://www.haskell.org/ghc/download_ghc_7_0_1#macosx_x86_64 should work (and we can close this ticket). Does someone need a 64 bit ghc for 10.5 (Leopard)? (I cannot make one.)

Changed 2 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

GHCi works in the current builds, so I agree that we can close this ticket now.

Note: See TracTickets for help on using tickets.