[GHC] #15155: How untagged pointers sneak into banged fields

GHC ghc-devs at haskell.org
Mon Oct 8 12:45:55 UTC 2018


#15155: How untagged pointers sneak into banged fields
-------------------------------------+-------------------------------------
        Reporter:  heisenbug         |                Owner:  heisenbug
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.4.2
      Resolution:                    |             Keywords:  CodeGen
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:  14677
 Related Tickets:  #13027 #7308      |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by heisenbug):

 Replying to [comment:12 simonpj]:
 > heisenbug: are you still interested in this ticket?

 Yes, I am totally interested that it doesn't get killed :-) Feel free to
 close as fixed-by, though.

 I ''think'' I have a plan to enforce following invariant:
 - An IND_STATIC closure should never point to a tagged constructor.

 For this one needs to track which local (module) names point to some other
 module's exported name, peeking through casts (i.e. representational
 equalities). This needs to go into a knot tying state in the backend (or
 perhaps STG) codegens. Should be mostly mechanical. Then the local
 references should statically dereference the local name and emit the other
 module's imported binding. Reading the assembly will be slightly harder,
 as some names will reflect the representational equalities explicitly.

 I am not sure that the above invariant is enough, considering the presence
 of BLACKHOLEs etc. But my gut feeling is that such evaluation-predicated
 closure kinds should never arise pointing to statically evaluated data.

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


More information about the ghc-tickets mailing list