Opened 9 years ago

Closed 8 years ago

#5132 closed bug (fixed)

Segfault on OS X in GHCi when using GHC API

Reported by: nominolo Owned by: igloo
Priority: high Milestone: 7.4.1
Component: GHCi Version: 7.0.2
Keywords: Cc: pho@…, jcpetruzza@…
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: GHCi crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


(This might be related to #5072.)

I get a segfault when loading and running the following simple program in GHCi:

import GHC
import DynFlags

main = do
  defaultErrorHandler defaultDynFlags $ do
    (a,b) <- parseStaticFlags []
    print "42"
$ ghci -package ghc bug3.hs
GHCi, version 7.0.2:  :? for help

Ok, modules loaded: Main.
Prelude Main> main
Bus error

It works fine on x86-64 linux or when I compile the code. I have not tested whether it fails on x86 as well.

Change History (5)

comment:1 Changed 9 years ago by igloo

Milestone: 7.2.1
Owner: set to igloo
Priority: normalhigh

This is probably the same as #5031.

comment:2 Changed 9 years ago by PHO

Cc: pho@… added

comment:3 Changed 9 years ago by jcpetruzza

Cc: jcpetruzza@… added

comment:4 Changed 8 years ago by igloo


comment:5 Changed 8 years ago by igloo

Resolution: fixed
Status: newclosed

I can reproduce this with 7.0.4:

*Main> main
Bus error: 10

but not with the 7.2.1 release build, nor (after changing defaultDynFlags to defaultLogAction) with my HEAD validate build.

So I think this is fixed, although I don't know by what change.

Note: See TracTickets for help on using tickets.