[GHC] #15508: concprog001 fails with various errors

GHC ghc-devs at haskell.org
Sun Jan 6 09:06:08 UTC 2019


#15508: concprog001 fails with various errors
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:  osa1
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.5
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Runtime crash     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15571            |  Differential Rev(s):  Phab:D5051
       Wiki Page:                    |  (reverted), Phab:D5165, Phab:D5178
-------------------------------------+-------------------------------------
Changes (by osa1):

 * cc: simonmar (added)


Comment:

 I came across something interesting. While digging deeper I found that
 this is
 where we assign a location of heap (instead of location of the arena where
 we
 allocate cost centre stacks) to a closure's CCS field:

 {{{
 #0  0x0000000000a15794 in raiseAsync (cap=0xd35700 <MainCapability>,
 tso=0x420320f000, exception=0xb570c0, stop_at_atomically=false,
 stop_here=0x0) at rts/RaiseAsync.c:873
 #1  0x0000000000a14aa6 in throwToMsg (cap=0xd35700 <MainCapability>,
 msg=0x42000be730) at rts/RaiseAsync.c:275
 #2  0x0000000000a148f0 in throwTo (cap=0xd35700 <MainCapability>,
 source=0x4205b6f728, target=0x420320f000, exception=0xb570c0) at
 rts/RaiseAsync.c:213
 #3  0x0000000000a3c323 in stg_killThreadzh ()
 #4  0x0000000000000000 in ?? ()
 }}}

 The closure (an `AP_STACK`) previously has this cost centre stack:

 {{{
 >>> print ((StgClosure *) 0x4200345e70)->header.prof.ccs
 $30 = (CostCentreStack *) 0xb44390
 >>> print *((StgClosure *) 0x4200345e70)->header.prof.ccs
 $31 = {
   ccsID = 241,
   cc = 0xb44350,
   prevStack = 0xd2df00 <CCS_MAIN>,
   indexTable = 0x0,
   root = 0xb44390,
   depth = 1,
   scc_count = 0,
   selected = 1,
   time_ticks = 0,
   mem_alloc = 59522362,
   inherited_alloc = 0,
   inherited_ticks = 0
 }
 }}}

 The new value is `0x4207528000`, a location in the heap.

 The new location is coming from another closure so I should debug more and
 see
 how the value ended up in that closure, but I noticed a `TODO` comment
 around
 the code that makes this assignment:

 {{{
             -- RaiseAsync.c:873
             SET_HDR(ap,&stg_AP_STACK_info,
                     ((StgClosure *)frame)->header.prof.ccs /* ToDo */);
 }}}

 I wonder if that `ToDo` has anything to do with this. @simonmar, any
 ideas? The
 commit that added that `ToDo`: b1953bbb1ed3cb16497e5447db7487f0c2d9e41a.

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


More information about the ghc-tickets mailing list