#2912: GHCi bug: bus error when executing some gsl-random core
----------------------+-----------------------------------------------------
Reporter:  fdeweerdt  |          Owner:                
    Type:  bug        |         Status:  new           
Priority:  normal     |      Component:  GHCi          
 Version:  6.10.1     |       Severity:  normal        
Keywords:             |       Testcase:                
      Os:  Linux      |   Architecture:  x86_64 (amd64)
----------------------+-----------------------------------------------------
 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

 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2912>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to