[GHC] #13916: Optimizations create run time seg faults

GHC ghc-devs at haskell.org
Sat Jul 8 01:34:44 UTC 2017


#13916: Optimizations create run time seg faults
-------------------------------------+-------------------------------------
        Reporter:  newthin           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
  (CodeGen)                          |
      Resolution:                    |             Keywords:  optimization
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 bgamari):

 Here is my analysis of `stg_takeMVarzh` for future reference,
 {{{
 stg_takeMVarzh:                              // $rbx = mvar
 <+0>:   mov    (%rbx),%rax                   // $rax = info =
 GET_INFO(mvar)
 <+3>:   cmpq   $0x94f128,0x18(%rbx)          // if (StgMVar_value(mvar) ==
 stg_END_TSO_QUEUE_closure)
 <+11>:  je     0x6ec277 <stg_takeMVarzh+295> //     { jump; } (not taken)
 <+17>:  mov    %rbx,%rcx
 <+20>:  mov    0x18(%rbx),%rdx               // $rdx = val =
 StgMVar_value(mvar)
 <+24>:  mov    0x8(%rbx),%rbx                // $rbx = q   =
 StgMVar_head(mvar)
 <+28>:  cmp    $0x94f128,%rbx                // if (q ==
 stg_END_TSO_QUEUE_closure)
 <+35>:  je     0x6ec236 <stg_takeMVarzh+230> //     { jump; } (not taken)
 <+41>:  cmpq   $0x6ed310,(%rbx)              // if (StgHeader_info(q) ==
 stg_IND_info)
                                              // ^ crashes here
 <+48>:  je     0x6ec22d <stg_takeMVarzh+221> //     { jump; }
 <+54>:  cmpq   $0x6ed938,(%rbx)              // if (StgHeader_info(q) ==
 stg_MSG_NULL_info)
 }}}

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


More information about the ghc-tickets mailing list