id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
2912,GHCi bug: bus error when executing some gsl-random code,fdeweerdt,,"When compiling this simple program, the resulting executable runs fine, while running it under ghci causes a crash.
It's gsl-random related obviously, but the difference in behaviour between plain ghc and ghci is somewhat odd.

{{{
$ cat a.hs
import Control.Monad
import Control.Monad.MC
import Control.Monad.MC.Class
import GHC.Word

seed = 57
buildRow el l = (sampleSubset el l [1..]) `evalMC` (mt19937 seed)

main = do
        mapM_ putStrLn (map show ((buildRow 2 10) :: [Double]))

$ ghc --make a.hs
[1 of 1] Compiling Main             ( a.hs, a.o )
Linking a ...
$ ./a 
1.0
6.0
$ ghci a.hs 
GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Ok, modules loaded: Main.
Prelude Main> main
Loading package syb ... linking ... done.
Loading package base-3.0.3.0 ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package mtl-1.1.0.2 ... linking ... done.
Loading package gsl-random-0.2.3 ... linking ... done.
Loading package uvector-0.1.0.3 ... linking ... done.
Loading package monte-carlo-0.2 ... linking ... done.
zsh: bus error  ghci a.hs

}}}",bug,closed,high,6.10.2,GHCi,6.10.1,duplicate,,patperry@…,Linux,x86_64 (amd64),,Unknown,,,,
