#2912: GHCi bug: bus error when executing some gsl-random code
-------------------------------+--------------------------------------------
    Reporter:  fdeweerdt       |        Owner:           
        Type:  bug             |       Status:  closed   
    Priority:  high            |    Milestone:  6.10.2   
   Component:  GHCi            |      Version:  6.10.1   
    Severity:  normal          |   Resolution:  duplicate
    Keywords:                  |   Difficulty:  Unknown  
    Testcase:                  |           Os:  Linux    
Architecture:  x86_64 (amd64)  |  
-------------------------------+--------------------------------------------
Changes (by simonmar):

  * status:  new => closed
 * cc: [email protected] (added)
  * resolution:  => duplicate

Comment:

 This is another instance of #781.  The problem is caused by this reference
 in the `gsl-random` package:

 {{{
 foreign import ccall unsafe "gsl/gsl_rng.h &gsl_rng_mt19937"
     p_gsl_rng_mt19937 :: Ptr (Ptr ())
 }}}

 The GHCi linker on x86_64 can't handle references to static data in shared
 libraries, because we only have a 32-bit field and we need a 64-bit
 offset.

 One way to workaround it is to use `-fPIC` when compiling gsl-random (I
 tested this, it works).  However, `-fPIC` is still quite experimental, so
 I hesitate to recommend this as a fix.  Another way to do it would be to
 have a C function that returns the address of `gsl_rng_mt19937`, and
 compile this with `-fPIC`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2912#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to