Skip to content

Interactive linker crash when partially applying seq#

Consider the following commands:

:set -XMagicHash
import GHC.IO
import GHC.Prim
IO (seq# ())

When the last statement is run in GHCi, the following error message is displayed:

ByteCodeLink.lookupCE(primop)
During interactive linking, GHCi couldn't find the following symbol:
  ghczmprim_GHCziPrimopWrappers_seqzh_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session.  Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
  glasgow-haskell-bugs@haskell.org

The expression works if I eta-unreduce the seq# call: IO (\x -> seq# () x). The problem seems to be exclusive to GHCi: if you put that expression in a file, it works fine when compiled by GHC, and even GHCi works fine when using the resulting .o file. When there's no .o GHCi still crashes, and eta-unreduction doesn't help anymore (something to with optimizations I guess).

I can also reproduce this on the Linux-x86 architecture.

Trac metadata
Trac field Value
Version 7.8.4-rc1
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC hvr
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information