[GHC] #12009: ASSERTION FAILED: file rts/LdvProfile.c, line 48

GHC ghc-devs at haskell.org
Thu May 5 04:00:47 UTC 2016


#12009: ASSERTION FAILED: file rts/LdvProfile.c, line 48
-------------------------------------+-------------------------------------
        Reporter:  erikd             |                Owner:  erikd
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.2
       Component:  Compiler          |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Runtime crash     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by erikd):

 Wow, this is interesting. Note that I am running the test program with
 `+RTS -hb -DS -N1` and its
 crashing in `processNurseryForDead` which has some code that looks like:

 {{{
         p = bd->start;
         while (p < bd->free) {
             while (p < bd->free && !*p) p++; // skip slop
             if (p >= bd->free) break;
 }}}

 The line with the `skip slop` comment is the interesting one. It assumes
 that if the block descriptor we are currently looking at is not full, then
 the memory from `bd->start` to `bd-free` with be all zeros.

 However, this is not the case when the RTS flags include `-DS` which turns
 on sanity checking. One part of this sanity checking is in the function
 `resetNurseries` of the file `rts/sm/Storage.c` which does this:

 {{{
         IF_DEBUG(sanity, memset(bd->start, 0xaa, BLOCK_SIZE));
 }}}

 That is, it fills the block with `0xaa` bytes which causes the "skip slop"
 code in `processNurseryForDead` to incorrectly skip the slop at the start
 of the block.

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


More information about the ghc-tickets mailing list