[GHC] #9480: Segfault in GHC API code using Shelly

GHC ghc-devs at haskell.org
Wed Aug 20 15:46:42 UTC 2014


#9480: Segfault in GHC API code using Shelly
-------------------------------------+-------------------------------------
              Reporter:  agibiansky  |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  GHC API     |          Version:  7.8.3
            Resolution:              |         Keywords:
      Operating System:  Linux       |     Architecture:  Unknown/Multiple
       Type of failure:  Runtime     |       Difficulty:  Unknown
  crash                              |       Blocked By:
             Test Case:              |  Related Tickets:  #8935
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 Here is the corresponding `-Dl` output when I build the snippet with 7.6:
 {{{
 Rel entry 101325 is raw(0x323c63 0x113a700000002 0xfffffffffffffffc)
 lookupSymbol: looking up environ
 initLinker: start
 initLinker: idempotent return
 lookupSymbol: symbol not found
 `environ' resolves to 0x24af250
 Reloc: P = 0x40429ca3   S = 0x24af250   A = 0xfffffffffffffffc
 }}}

 This time the linker found `environ` in the executable, which is good (as
 it's near where we load object files):
 {{{
 rwbarton at morphism:/tmp/shl$ nm /tmp/shl/shl
 [...]
 00000000024af250 V environ@@GLIBC_2.2.5
 [...]
 }}}

 So, the problem must be that in 7.8 `internal_dlsym` is finding `environ`
 in one of the `openedSOs` before it gets to looking in the executable. Why
 does it not look in the executable first? Time to reread #8935 I guess...

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


More information about the ghc-tickets mailing list