Ticket #2039 (closed bug: worksforme)

Opened 5 years ago

Last modified 5 years ago

Using GHC 6.8.2 as a library does not work well under Windows in GHCi

Reported by: PVerswyvelen Owned by:
Priority: lowest Milestone: 6.8.3
Component: GHC API Version: 6.8.2
Keywords: GHC API GHCi runtime linker duplicate symbol Cc:
Operating System: Windows Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

When executing the following code with GHCi 6.8.2 under Windows

----->8--------
import DynFlags

import GHC

main = defaultErrorHandler defaultDynFlags $ do
  session <- newSession (Just "d:\\app\\ghc-6.8.2")
  flags <- getSessionDynFlags session
  (flags, _) <- parseDynamicFlags flags []
  GHC.defaultCleanupHandler flags $ do
    setSessionDynFlags session flags{ hscTarget=HscInterpreted }
    prelude <- findModule session (mkModuleName "Prelude") Nothing
    setContext session [] [prelude]
    runStmt session "let n = 2 + 2" RunToCompletion 
    runStmt session "n"  RunToCompletion 
----->8--------

You get the following error:

Loading package array-0.1.0.0 ... linking ... done.
Loading package packedstring-0.1.0.0 ... linking ... done.
Loading package containers-0.1.0.1 ... linking ... done.
Loading package old-locale-1.0.0.0 ... linking ... done.
Loading package old-time-1.0.0.0 ... linking ... done.
Loading package filepath-1.1.0.0 ... linking ... done.
Loading package directory-1.0.0.0 ... linking ... done.
Loading package process-1.0.0.0 ... linking ... done.
Loading package pretty-1.0.0.0 ... linking ... done.
Loading package hpc-0.5.0.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package Cabal-1.2.3.0 ... linking ... done.
Loading package random-1.0.0.0 ... linking ... done.
Loading package haskell98 ... linking ... done.
Loading package bytestring-0.9.0.1 ... linking ... done.
Loading package Win32-2.1.1.0 ... linking ... done.
Loading package ghc-6.8.2 ... linking ... done.


GHCi runtime linker: fatal error: I found a duplicate definition for symbol
   _forkOS_entry
whilst processing object file
   d:/app/ghc-6.8.2/lib\base-3.0.1.0/HSbase-3.0.1.0.o
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.
GHCi cannot safely continue in this situation.  Exiting now.  Sorry.

It works fine under Linux. It also works when using GHC --make under Windows, however I do get errors when using hs-plugins under Windows, which seems related.

I haven't tried with GHC 6.9 yet.

Change History

Changed 5 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.8.3

Thanks for the report. We'll try to have a look for 6.8.3.

Changed 5 years ago by igloo

  • priority changed from normal to lowest

I can't reproduce this (with ghci or ghcii.sh, under cmd, msys or cygwin), e.g.:

$ ghcii.sh -package ghc q.hs
GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Loading package old-locale-1.0.0.0 ... linking ... done.
Loading package old-time-1.0.0.0 ... linking ... done.
Loading package filepath-1.1.0.0 ... linking ... done.
Loading package directory-1.0.0.0 ... linking ... done.
Loading package array-0.1.0.0 ... linking ... done.
Loading package containers-0.1.0.1 ... linking ... done.
Loading package hpc-0.5.0.0 ... linking ... done.
Loading package bytestring-0.9.0.1 ... linking ... done.
Loading package pretty-1.0.0.0 ... linking ... done.
Loading package packedstring-0.1.0.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package Win32-2.1.1.0 ... linking ... done.
Loading package process-1.0.0.0 ... linking ... done.
Loading package Cabal-1.2.3.0 ... linking ... done.
Loading package random-1.0.0.0 ... linking ... done.
Loading package haskell98 ... linking ... done.
Loading package ghc-6.8.2 ... linking ... done.
[1 of 1] Compiling Main             ( q.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
4
*Main> :q
Leaving GHCi.

Changed 5 years ago by igloo

  • status changed from new to closed
  • resolution set to worksforme
Note: See TracTickets for help on using tickets.