[GHC] #9274: GHC panic with UnliftedFFITypes+CApiFFI

GHC ghc-devs at haskell.org
Mon Oct 16 17:03:54 UTC 2017


#9274: GHC panic with UnliftedFFITypes+CApiFFI
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                Owner:  igloo
            Type:  bug               |               Status:  patch
        Priority:  high              |            Milestone:  8.2.2
       Component:  Compiler          |              Version:  7.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  phab:D4092
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Herbert Valerio Riedel <hvr@…>):

 In [changeset:"add85cc2a3ec0bda810dca2a35264308ffaab069/ghc"
 add85cc2/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="add85cc2a3ec0bda810dca2a35264308ffaab069"
 Fix panic for `ByteArray#` arguments in CApiFFI foreign imports

 Declarations such as

   foreign import capi  unsafe "string.h strlen"
       c_strlen_capi :: ByteArray# -> IO CSize

   foreign import capi  unsafe "string.h memset"
       c_memset_capi :: MutableByteArray# s -> CInt -> CSize -> IO ()

 would cause GHC to panic because the CApiFFI c-wrapper generator didn't
 know what C type to use for `(Mutable)ByteArray#` types (unlike the
 `ccall` codepath).

 This addresses #9274

 Reviewed By: bgamari

 Differential Revision: https://phabricator.haskell.org/D4092
 }}}

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


More information about the ghc-tickets mailing list