[GHC] #13997: GHCi panic: "Loading temp shared object failed" when adding a new module

GHC ghc-devs at haskell.org
Wed Jul 19 12:22:40 UTC 2017


#13997: GHCi panic: "Loading temp shared object failed" when adding a new module
-------------------------------------+-------------------------------------
           Reporter:  mbieleck       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1-rc3
           Keywords:  panic GHCi     |  Operating System:  Unknown/Multiple
       Architecture:  x86_64         |   Type of failure:  Compile-time
  (amd64)                            |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Files:

 {{{#!hs
 -- Bug.hs
 module Bug where
 import Bug2
 bug = bug2

 -- Bug2.hs
 module Bug2 where
 bug2 = ()
 }}}

 Steps to reproduce:

 1. Create the files as above
 2. Start GHCi:

 {{{
 $ ghc-8.2.0.20170704 --interactive -fobject-code
 λ> :load Bug
 Ok, 2 modules loaded.
 }}}

 3. Without exiting GHCi, add a new file:

 {{{#!hs
 -- NewModule.hs
 module NewModule where
 newFn = ()
 }}}

 and change `Bug2.hs` to:

 {{{#!hs
 module Bug2 where
 import NewModule
 bug2 = newFn
 }}}

 to introduce a transitive dependency `Bug -> Bug2 -> NewModule`.

 4. In GHCi

 {{{
 λ> :reload
 [2 of 3] Compiling Bug2             ( Bug2.hs, Bug2.o )
 Ok, 3 modules loaded.
 λ> bug
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.2.0.20170704 for x86_64-unknown-linux):
         Loading temp shared object failed: /tmp/ghc22212_0/libghc_4.so:
 undefined symbol: NewModule_newFn_closure

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

 }}}

 The problem also exists without `-fobject-code`. The error message is
 different:

 {{{
 λ> bug
 ghc: ^^ Could not load 'NewModule_newFn_closure', dependency unresolved.
 See top entry above.


 ByteCodeLink.lookupCE
 During interactive linking, GHCi couldn't find the following symbol:
   NewModule_newFn_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 at haskell.org
 }}}

 Also affects GHC 8.0.2 and 7.10.

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


More information about the ghc-tickets mailing list