Ticket #3530 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

GHCi does not work on Snow Leopard

Reported by: chak Owned by: chak
Priority: high Milestone: 6.12.1
Component: GHCi Version: 6.11
Keywords: Cc:
Operating System: MacOS X Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

When compiling GHC as a 32-bit application on Snow Leopard (Mac OS X 10.6), the generated ghci aborts with a Bus Error (null pointer dereference) on startup (after it has loaded all packages). This happens only when GHC was compiled on Snow Leopard (not if a binary built on Leopard is used on Snow Leopard) and if GHCi is used interactively (if a set of commands is redirected into ghci —as in ghc < myscript— the problem doesn't occur).

In addition to the failure of GHCi on startup for interactive use, the following five regression tests fail when validating:

   TH_repE2(normal)               -- the failing declaration is: an_integer
   TH_repPrim(normal)             -- the failing tests is: [| D# 24.6## |]
   ann01(normal)                  -- all annotations with a Double fail
   ffi018_ghci(ghci)
   prog002(ghci)

Moreover, with WAY=ghci in codeGen/, we have the following failures:

   cg014(ghci)
   cg024(ghci)
   cg026(ghci)
   cg028(ghci)
   cg034(ghci)
   cg035(ghci)
   cg044(ghci)

Observation: All of the failing tests use 'Double'.

Workaround: For the 6.12 release, by building a 32-bit binary on Leopard for use on both Leopard and Snow Leopard, the fault on starting GHCi can be avoided. I haven't checked whether that avoids the problems with the listed regressions, too.

Change History

  Changed 2 years ago by chak

I did now run validate on Snow Leopard with a tree built on Leopard. It passed. Hence, the problems described in this ticket are entirely due to building on Snow Leopard.

  Changed 2 years ago by maurer

Maybe this is a useless comment, but as Snow Leopard requires a 64-bit machine anyways, and is explicitly trying to get rid of 32-bit code, it could make sense to drop 32-bit support on Snow Leopard and beyond.

  Changed 2 years ago by altaic

Actually, Snow Leopard does not require a 64-bit machine, and all SL apps are x86/x86_64 Universal.

I've read that gcc defaults to building x86_64, however on my core duo (read: 32-bit) mac, gcc -dumpmachine reports "i686-apple-darwin10" not "x86_64-apple-darwin10" as I imagine it would if that were true. So perhaps gcc defaults to the host arch in some manner (there is additional confusion because even on 64-bit machines SL defaults to booting the 32-bit kernel, but defaults to running and building 64-bit apps).

Regardless, please don't drop 32-bit support! :)

  Changed 2 years ago by igloo

  • priority changed from normal to high
  • difficulty set to Unknown
  • milestone set to 6.12.1

It would be great if someone could track this down.

  Changed 2 years ago by altaic

It may be worthwhile to note that supporting builds of universal binaries would solve this issue. Or perhaps that depends on this issue. Those tickets are:

 http://hackage.haskell.org/trac/ghc/ticket/872
 http://hackage.haskell.org/trac/ghc/ticket/964

Also, it's important to note that previously "Universal Binary" meant PPC+x86 in one binary, but post Snow Leopard it refers to x86+x86_64; PPC support was dropped for SL, and the new "deprecated" architecture is x86.

  Changed 2 years ago by chak

We definitely want both 32-bit and 64-bit support, but this ticket really is only about fixing the regression of GHCi from 32-bit Leopard to 32-bit Snow Leopard.

follow-up: ↓ 8   Changed 2 years ago by simonmar

There's a possibility that this may have been fixed by #3546. Might be worth trying again.

in reply to: ↑ 7   Changed 2 years ago by chak

Replying to simonmar:

There's a possibility that this may have been fixed by #3546. Might be worth trying again.

No, unfortunately, the fix to #3546 doesn't change anything.

  Changed 2 years ago by simonmar

  • owner set to chak

  Changed 2 years ago by chak

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

Fixed by

Thu Oct 29 23:41:59 EST 2009  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
  * Fix a dynamic linker bug that killed ghci on Snow Leopard

Please MERGE to the 6.12 branch!

  Changed 2 years ago by igloo

Merged.

Note: See TracTickets for help on using tickets.