Opened 6 years ago

Closed 6 years ago

#5031 closed bug (fixed)

GHC API (7.0.2) + runhaskell causes bus error in Mac OS X 10.6

Reported by: guest Owned by: igloo
Priority: high Milestone: 7.4.1
Component: GHC API Version: 7.0.2
Keywords: ghc api, runhaskell, ghci, segv Cc: konn.jinro@…, pho@…, jcpetruzza@…
Operating System: MacOS X Architecture: x86
Type of failure: None/Unknown Test Case: dynCompileExpr
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

On OS X 10.6.6, GHC API causes bus error when it is used from ghci/runhaskell.

Minimal case (ghc-api.hs) is below:

import GHC
import GHC.Paths

main = do
  runGhc (Just libdir) $ do
    getSessionDynFlags >>= setSessionDynFlags
    dynCompileExpr "()"

Run it by "runhaskell", then bus error was occurred. We can also cause same bug using GHCi as below:

Prelude> :m GHC GHC.Paths 
Prelude GHC GHC.Paths> runGhc (Just libdir) $ getSessionDynFlags >>= setSessionDynFlags >> dynCompileExpr "()"
Loading package array-0.3.0.2 ... linking ... done.
Loading package containers-0.4.0.0 ... linking ... done.
Loading package pretty-1.0.1.2 ... linking ... done.
Loading package Cabal-1.10.1.0 ... linking ... done.
Loading package bytestring-0.9.1.10 ... linking ... done.
Loading package ghc-binary-0.5.0.2 ... linking ... done.
Loading package bin-package-db-0.0.0.0 ... linking ... done.
Loading package hpc-0.5.0.6 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package ghc-7.0.2 ... linking ... done.
Loading package ghc-paths-0.1.0.8 ... linking ... done.
zsh: segmentation fault  ghci

The Crash Report generated by system is attached.

Attachments (1)

ghc_2011-03-16-232229_Macintosh.crash (2.2 KB) - added by guest 6 years ago.
Crash report generated by system.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by guest

Crash report generated by system.

comment:1 Changed 6 years ago by guest

Architecture: Unknown/Multiplex86
Operating System: Unknown/MultipleMacOS X

comment:2 Changed 6 years ago by PHO

Cc: pho@… added

comment:3 Changed 6 years ago by altaic

Just FYI, I'm not able to reproduce the crash with OS X 10.6.6 (Xcode 4.0) x86-64 HEAD.

comment:4 Changed 6 years ago by igloo

Milestone: 7.2.1
Owner: set to igloo
Priority: normalhigh

I can reproduce this with 7.0.2 and 7.0.3 on i386 OS X.

I can reproduce this with 7.0.2 on amd64 OS X.

I cannot reproduce it with HEAD in i386 OS X.

I cannot reproduce it with 7.0.2 on amd64 Linux.

I'll do a normal (non-validate) HEAD build, and see if I can reproduce it with that.

~/bindists/7.0.3-32/inst/bin/ghci -package ghc
:m + GHC
runGhc (Just "/Users/ian/bindists/7.0.3-32/inst/lib/ghc-7.0.3") $ getSessionDynFlags >>= setSessionDynFlags >> dynCompileExpr "()"
Segmentation fault
ghc/git/val32/inplace/bin/ghc-stage2 --interactive -package ghc
:m + GHC
runGhc (Just "/Users/ian/ghc/git/val32/inplace/lib") $ getSessionDynFlags >>= setSessionDynFlags >> dynCompileExpr "()"
<<()>>

comment:5 Changed 6 years ago by PHO

FYI, I can reproduce it with both 7.0.3 and HEAD on ppc32 OS X 10.5.8. The crash report is basically the same as the attached one.

comment:6 Changed 6 years ago by igloo

This is probably the same as #5132.

comment:7 Changed 6 years ago by jcpetruzza

Cc: jcpetruzza@… added

comment:8 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:9 Changed 6 years ago by igloo

Test Case: dynCompileExpr

comment:10 Changed 6 years ago by igloo

Resolution: fixed
Status: newclosed

Works with a normal HEAD x86 OS X build too.

Note: See TracTickets for help on using tickets.