[GHC] #8935: Obscure linker bug leads to crash in GHCi
GHC
ghc-devs at haskell.org
Wed May 7 17:03:30 UTC 2014
#8935: Obscure linker bug leads to crash in GHCi
-------------------------------------+------------------------------------
Reporter: simonmar | Owner: simonmar
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 dagit):
Great and thanks for the examples!
By the way, weak not making a difference is the other half of the point I
wanted to make :) I'm glad we're on the same page. I feel like I've
learned something useful that I can use elsewhere.
You might also look at `RTLD_DEEPBIND` for doing the initial symbol match
up (when you use `RTLD_LOCAL`). I can't be certain, but I think it may
help when reloading a shared object (presumably with new definitions
inside). As far as I can tell, that option was added specifically for uses
like this (I found some mailing list threads about it). I suspect the
point with that option is that it allows consistent behavior even if
something you don't have control over passes `RTLD_GLOBAL` to `dlopen`. My
prediction is that if you switch to using `RTLD_LOCAL`, then you won't
need `RTLD_DEEPBIND` in 99% of cases.
Also, I played with `RTLD_NEXT`, to see if I could locate the last symbol
loaded, but I couldn't figure out when I had reached the end and I also
wasn't able to lookup the symbol in the executable that way. I wish I
understood what they mean by next.
Thanks!
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8935#comment:38>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list