[GHC] #15038: Memory Corruption (strange closure type)

GHC ghc-devs at haskell.org
Sat Apr 28 14:55:46 UTC 2018


#15038: Memory Corruption (strange closure type)
-------------------------------------+-------------------------------------
        Reporter:  andrewthad        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Runtime crash     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 > STG that is produced for this?

 Do you mean STG for `absentError` or the function with wrong CAFFY-ness
 information? I haven't checked `absentError` but this is the STG for the
 function with wrong CAFFYness information:

 {{{
 lvl3_rctu
   :: forall s.
      Packed.Bytes.Parser.Maybe# (Packed.Bytes.Parser.Leftovers# s)
      -> GHC.Prim.State# s
      -> (# GHC.Prim.State# s,
            Packed.Bytes.Parser.Result# s GHC.Types.Word #)
 [GblId,
  Arity=2,
  Caf=NoCafRefs,
  Str=<S,1*U><S,U>,
  Unf=OtherCon []] =
     [] \r [us_gcwc us_gcwd us_gcwe us_gcwf us_gcwg void_0E]
         case us_gcwc of tag_gcwh {
           __DEFAULT ->
               (#,,,,,,#) [1#
                           Control.Exception.Base.absentError
                           Control.Exception.Base.absentError
                           0##
                           0##
                           1#
                           Control.Exception.Base.absentError];
           2# ->
               case ># [us_gcwg 0#] of {
                 __DEFAULT ->
                     case Packed.Bytes.Parser.nextNonEmpty us_gcwe
 GHC.Prim.void# of {
                       (#,,,,#) us_gcwi us_gcwj us_gcwk us_gcwl us_gcwm ->
                           case us_gcwi of tag_gcwn {
                             __DEFAULT ->
                                 (#,,,,,,#) [1#
 Control.Exception.Base.absentError
 Control.Exception.Base.absentError
                                             0##
                                             0##
                                             1#
 Control.Exception.Base.absentError];
                             2# ->
                                 case -# [us_gcwm 1#] of sat_scuk {
                                   __DEFAULT ->
                                       case +# [us_gcwl 1#] of sat_scuj {
                                         __DEFAULT ->
                                             (#,,,,,,#) [2#
                                                         us_gcwj
                                                         us_gcwk
                                                         sat_scuj
                                                         sat_scuk
                                                         2#
                                                         a1_rcbR];
                                       };
                                 };
                           };
                     };
                 1# ->
                     case -# [us_gcwg 1#] of sat_scur {
                       __DEFAULT ->
                           case +# [us_gcwf 1#] of sat_scuq {
                             __DEFAULT ->
                                 (#,,,,,,#) [2# us_gcwd us_gcwe sat_scuq
 sat_scur 2# a1_rcbR];
                           };
                     };
               };
         };
 }}}

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


More information about the ghc-tickets mailing list