Ticket #5031 (closed bug: fixed)

Opened 2 years ago

Last modified 20 months ago

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 Difficulty:
Test Case: dynCompileExpr Blocked By:
Blocking: Related Tickets:

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

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

Change History

Changed 2 years ago by guest

Crash report generated by system.

Changed 2 years ago by guest

  • os changed from Unknown/Multiple to MacOS X
  • architecture changed from Unknown/Multiple to x86

Changed 2 years ago by PHO

  • cc pho@… added

Changed 2 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.

Changed 2 years ago by igloo

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

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 "()"
<<()>>

Changed 2 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.

Changed 2 years ago by igloo

This is probably the same as #5132.

Changed 2 years ago by jcpetruzza

  • cc jcpetruzza@… added

Changed 21 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 20 months ago by igloo

  • testcase set to dynCompileExpr

Changed 20 months ago by igloo

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

Works with a normal HEAD x86 OS X build too.

Note: See TracTickets for help on using tickets.