[GHC] #229: Integer overflow in array allocation

GHC ghc-devs at haskell.org
Thu Dec 15 23:52:10 UTC 2016


#229: Integer overflow in array allocation
-------------------------------------+-------------------------------------
        Reporter:  josefs            |                Owner:  bgamari
            Type:  bug               |               Status:  patch
        Priority:  high              |            Milestone:  8.2.1
       Component:  Core Libraries    |              Version:  7.9
      Resolution:                    |             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:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"cd4b202f24da928adf66c05443b457002ab6a3e1/ghc" cd4b202/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="cd4b202f24da928adf66c05443b457002ab6a3e1"
 array: Check for integer overflow during allocation

 This fixes #229, where creating a new array can cause array to allocate
 a smaller array than it thinks it allocates due to integer overflow,
 resulting in memory unsafety.

 This breaks the rts/overflow1 test, which relied on this unchecked
 overflow. I fix it by reimplementing the test in terms of newByteArray#
 directly.

 Updates the array submodule.
 }}}

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


More information about the ghc-tickets mailing list