[GHC] #15728: Program with safe array operations triggers debug runtime assertion

GHC ghc-devs at haskell.org
Tue Oct 9 17:58:11 UTC 2018


#15728: Program with safe array operations triggers debug runtime assertion
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  highest           |            Milestone:
       Component:  Runtime System    |              Version:  8.6.1
      Resolution:  invalid           |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Sigh. The problem was staring at me the entire time: the testcase is
 wrong.

 Specifically:
 {{{#!hs
   arr <- newSmallArray n 0
   forM_ [1..n] $ \i ->
     writeSmallArray arr i i
 }}}
 `[1..n]` will produce an out-of-bounds index for the allocated array.

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


More information about the ghc-tickets mailing list