[GHC] #8935: Obscure linker bug leads to crash in GHCi
GHC
ghc-devs at haskell.org
Wed May 7 20:59:39 UTC 2014
#8935: Obscure linker bug leads to crash in GHCi
-------------------------------------+------------------------------------
Reporter: simonmar | Owner: trommler
Type: bug | Status: patch
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):
Replying to [comment:41 simonmar]:
> @trommler, giving you the ticket.
Thanks!
>
> Thinking about it, I'm less sure that `RTLD_LOCAL` will work now,
because it won't allow us to load new libraries that depend on libraries
we've previously loaded, and we definitely need to be able to do that.
For libraries (SOs) coming from installed packages everything should be
fine. The have a `NEEDED` tag for all dependencies and the system linker
will `dlopen()` them and resolve the symbols.
So for new libraries temporary SOs need to be produced the same way SOs in
packages are, with `NEEDED` tags for all previously loaded libraries. The
new library could potentially depend on all previously loaded libraries.
I am thinking of something along the lines of:
{{{
ld -shared temp.o ... < -l for each library loaded so far >
}}}
Perhaps we could remove libraries from the list that are not needed by the
new library by using `--as-needed` but I want to check first if this flag
is GNU ld specific.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8935#comment:42>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list