[GHC] #15729: Static GHCi can segfault when accessing .bss section in C

GHC ghc-devs at haskell.org
Tue Oct 16 00:00:11 UTC 2018


#15729: Static GHCi can segfault when accessing .bss section in C
-------------------------------+--------------------------------------
        Reporter:  watashi     |                Owner:  watashi
            Type:  bug         |               Status:  new
        Priority:  normal      |            Milestone:
       Component:  GHCi        |              Version:  8.6.1
      Resolution:              |             Keywords:
Operating System:  Linux       |         Architecture:  x86_64 (amd64)
 Type of failure:  GHCi crash  |            Test Case:
      Blocked By:              |             Blocking:
 Related Tickets:  #781        |  Differential Rev(s):  Phab:D5219
       Wiki Page:              |
-------------------------------+--------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"8306141397d6e47a169dbe4b7ff1b3319a502aa7/ghc"
 83061413/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="8306141397d6e47a169dbe4b7ff1b3319a502aa7"
 Allocate bss section within proper range of other sections

 Allocate bss section within proper range of other sections:

 * when `+RTS -xp` is passed, allocate it contiguously as we did for
   jump islands
 * when we mmap the code to lower 2Gb, we should allocate bss section
   there too

 This depends on {D5195}

 Test Plan:
 1. `./validate`

 2.

 with

 ```
 DYNAMIC_GHC_PROGRAMS = NO
 DYNAMIC_BY_DEFAULT = NO
 ```

 `TEST="T15729" make test` passed in both linux and macos.

 3.

 Also test in a use case where we used to encouter error like:

 ```
 ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) =
 b90282ba
 ```

 and now, everything works fine.

 Reviewers: simonmar, bgamari, angerman, erikd

 Reviewed By: simonmar

 Subscribers: rwbarton, carter

 GHC Trac Issues: #15729

 Differential Revision: https://phabricator.haskell.org/D5219
 }}}

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


More information about the ghc-tickets mailing list