[GHC] #13611: Segfault due to levity polymorphism of mkWeak#

GHC ghc-devs at haskell.org
Mon Apr 24 17:11:10 UTC 2017


#13611: Segfault due to levity polymorphism of mkWeak#
-------------------------------------+-------------------------------------
           Reporter:  nomeata        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This code segfaults:

 {{{
 {-# LANGUAGE MagicHash, UnboxedTuples #-}
 import GHC.Prim
 import GHC.Types

 main = do
     let local = ()
     let null = 0## :: Word#
     let triple = (# local, null, null #)
     IO (\s -> case mkWeakNoFinalizer# triple () s of (# s, r #) -> (# s,
 () #))
 }}}


 The problem is that `mkWeakNoFinalizer#` has a levity polymorphic type for
 its first argument, but the implementation really requires the first
 argument to be a pointer.

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


More information about the ghc-tickets mailing list