#5053: Internal error with runhaskell and System.Plugins.dynload
---------------------------------+------------------------------------------
    Reporter:  robnik            |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.2             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 I've been trying to learn how to use the `plugins` package, specifically
 the `dynload` function.  I ran some code and got the message below:  (The
 "Loading" is from my program)

 {{{
 > runhaskell Main.hs
 Loading
 Main.hs: internal error: evacuate: strange closure type 894
     (GHC version 7.0.2 for i386_apple_darwin)
     Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 }}}

 I've copied the two relevant files below - Main.hs and Plug.hs.  Before
 running Main.hs I compiled Plug.hs to Plug.o by running `ghc -c Plug.hs`.
 All files are in the same directory.

 Main.hs:

 {{{
 -- Test dynamic loading

 module Main (main) where

 import System.Plugins
 import Data.Dynamic

 main :: IO ()
 main = do
   putStrLn "Loading"
   mv <- dynload "Plug.o" [] [] "thing"
   putStrLn "Loaded"
   case mv of
     LoadFailure msgs -> putStrLn "fail" >> print msgs
     LoadSuccess _ v -> putStrLn "success" >> print (v::Integer)
 }}}

 Plug.hs:

 {{{
 module Plug (thing) where
 import Data.Dynamic
 thing :: Dynamic
 thing = toDyn (1234000::Integer)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5053>
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