[GHC] #15571: Eager AP_STACK blackholing causes incorrect size info for sanity checks

GHC ghc-devs at haskell.org
Thu Sep 20 10:58:06 UTC 2018


#15571: Eager AP_STACK blackholing causes incorrect size info for sanity checks
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Runtime System    |              Version:  8.5
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15508            |  Differential Rev(s):  Phab:D5165
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 I submitted a patch.

 Simon, looking at this note

 {{{
    Note [zeroing slop]

    In some scenarios we write zero words into "slop"; memory that is
    left unoccupied after we overwrite a closure in the heap with a
    smaller closure.

    Zeroing slop is required for:

     - full-heap sanity checks (DEBUG, and +RTS -DS)
     - LDV profiling (PROFILING, and +RTS -hb)

    Zeroing slop must be disabled for:

     - THREADED_RTS with +RTS -N2 and greater, because we cannot
       overwrite slop when another thread might be reading it.

    Hence, slop is zeroed when either:

     - PROFILING && era <= 0 (LDV is on)
     - !THREADED_RTS && DEBUG

    And additionally:

     - LDV profiling and +RTS -N2 are incompatible
     - full-heap sanity checks are disabled for THREADED_RTS
 }}}

 This says that we can't zero slops in threaded runtime and heap sanity
 checks
 are disabled in threaded runtime, but that's not true. I can see in gdb
 that we
 do full heap sanity check in threaded programs too. Do you know what
 changed
 since this comment? I'm surprised that sanity checks work at all in
 threaded
 runtime because we don't zero the slops...

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


More information about the ghc-tickets mailing list