[GHC] #8935: Obscure linker bug leads to crash in GHCi

GHC ghc-devs at haskell.org
Tue May 6 08:11:47 UTC 2014


#8935: Obscure linker bug leads to crash in GHCi
-------------------------------------+------------------------------------
        Reporter:  simonmar          |            Owner:  simonmar
            Type:  bug               |           Status:  infoneeded
        Priority:  high              |        Milestone:  7.8.3
       Component:  Runtime System    |          Version:  7.8.1-rc2
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  GHCi crash        |       Difficulty:  Rocket Science
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by trommler):

 I have the following fix in mind: In `internal_dlsym` search the default
 handle first and then the list of SOs opened so far.

 But there are a few things in `Linker.c` that I don't understand yet:

 1. `hdl` is `dl_prog_handle` in all two call sites. Do we need that
 parameter or could we instead use the static variable `dl_prog_handle`
 directly?
 1. With `hdl` being `dl_prog_handle`: In `internal_dlsym` the SO pointed
 to by `hdl` is searched last. Why can I not look there first?
 1. In `internal_dlopen` the SO is opened with `RTLD_GLOBAL` but we want to
 be able to override symbols later when we reload a library. Why is
 `RTLD_GLOBAL` needed?

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


More information about the ghc-tickets mailing list