Opened 3 years ago

Closed 3 years ago

#5053 closed bug (fixed)

Internal error with runhaskell and System.Plugins.dynload

Reported by: robnik Owned by: igloo
Priority: normal Milestone: 7.2.1
Component: Compiler Version: 7.0.2
Keywords: Cc:
Operating System: MacOS X Architecture: x86
Type of failure: Runtime crash Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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)

Change History (3)

comment:1 Changed 3 years ago by robnik

  • Architecture changed from Unknown/Multiple to x86
  • Operating System changed from Unknown/Multiple to MacOS X
  • Type of failure changed from None/Unknown to Runtime crash

comment:2 Changed 3 years ago by igloo

  • Milestone set to 7.2.1
  • Owner set to igloo

Thanks for the report. I'll see if I can reproduce it.

comment:3 Changed 3 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

I can reproduce this with 7.0, but my cut-down version works fine with the HEAD. So I think this is fixed, but if you have problems again with 7.2, please file a ticket.

Note: See TracTickets for help on using tickets.