[GHC] #12756: ghci gives stg_ap_v_ret error

GHC ghc-devs at haskell.org
Sun Oct 23 12:40:46 UTC 2016


#12756: ghci gives stg_ap_v_ret error
----------------------------------+--------------------------------------
        Reporter:  ryanreich      |                Owner:
            Type:  bug            |               Status:  new
        Priority:  normal         |            Milestone:
       Component:  GHCi           |              Version:  8.0.1
      Resolution:                 |             Keywords:
Operating System:  Linux          |         Architecture:  x86_64 (amd64)
 Type of failure:  Runtime crash  |            Test Case:
      Blocked By:                 |             Blocking:
 Related Tickets:                 |  Differential Rev(s):
       Wiki Page:                 |
----------------------------------+--------------------------------------

Comment (by AlexET):

 After a bit of reducing I think there is a bug in the code meaning the
 `unsafeRead`/`unsafeWrite` in `addBigWords` are out of bounds. This is
 because although we have arrays we use have bounds `(1,1)` and we write at
 index `1`, `unsafeRead` and `unsafeWrite` always use 0-indexed array
 indexes rather than using the array bounds (because they are meant to be
 fast and unsafe). The OOB write means that any thing can happen. In the
 case of compiled we happen to ignore it, when interpreted we happen to
 crash.

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


More information about the ghc-tickets mailing list