[GHC] #8614: Duplicate symbol error when loading text twice

GHC ghc-devs at haskell.org
Sun Dec 15 23:46:42 UTC 2013


#8614: Duplicate symbol error when loading text twice
------------------------------------+-------------------------------------
       Reporter:  nh2               |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.6.3
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  GHCi crash
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 We are developing some FFI binding to some Kinect Camera library, and came
 across the following:


 {{{
 GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Prelude> import Honi
 Prelude Honi> import Honi.Types
 Prelude Honi Honi.Types> initialize 2
 Loading package array-0.4.0.1 ... linking ... done.
 Loading package deepseq-1.3.0.1 ... linking ... done.
 Loading package bytestring-0.10.0.2 ... linking ... done.
 Loading package text-0.11.3.1 ... linking ... done.
 Loading package honi-0.1.0.0 ... can't load .so/.DLL for: libfreenect.so
 (libfreenect.so: cannot open shared object file: No such file or
 directory)
 Prelude Honi Honi.Types> Right [d] <- getDeviceList
 Loading package array-0.4.0.1 ... linking ... done.
 Loading package deepseq-1.3.0.1 ... linking ... done.
 Loading package bytestring-0.10.0.2 ... linking ... done.
 Loading package text-0.11.3.1 ...

 GHCi runtime linker: fatal error: I found a duplicate definition for
 symbol
    __stginit_textzm0zi11zi3zi1_DataziText
 whilst processing object file
    /home/niklas/.cabal/lib/x86_64-linux-
 ghc-7.6.3/text-0.11.3.1/libHStext-0.11.3.1.a
 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.
 }}}

 Apparently, ghci has no problem linking packages like array and deepseq
 twice, but when it comes across loading text another time, we get this
 duplicate symbol error.

 Does this make sense?
 Why does it not detect that text is already linked, like for the other
 packages?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8614>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list