[GHC] #12573: Allow the user to pick the address that the RTS reserves for the heap

GHC ghc-devs at haskell.org
Mon Sep 5 16:44:59 UTC 2016


#12573: Allow the user to pick the address that the RTS reserves for the heap
-------------------------------------+-------------------------------------
           Reporter:  bitonic        |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Runtime        |           Version:  8.0.1
  System                             |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 We stumbled upon a case where an external library (OpenCL) does not work
 if a specific address (0x200000000) is taken.

 It so happens that `osReserveHeapMemory` starts trying to `mmap` at
 `0x200000000`:

 {{{
         void *hint = (void*)((W_)8 * (1 << 30) + attempt * BLOCK_SIZE);
         at = osTryReserveHeapMemory(*len, hint);
 }}}

 This makes it impossible to use Haskell programs compiled with GHC 8 with
 C functions that use OpenCL.

 See this example https://github.com/chpatrick/oclwtf for a repro.

 My proposal is to allow the user to work around this kind of behavior
 outside our control by letting the user override the starting address
 through an RTS command line flag.

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


More information about the ghc-tickets mailing list