[GHC] #11487: stg_ap_pp_fast doesn't pass the argument in the arity=1 case

GHC ghc-devs at haskell.org
Tue Jan 26 17:20:45 UTC 2016


#11487: stg_ap_pp_fast doesn't pass the argument in the arity=1 case
-----------------------------------+---------------------------------
        Reporter:  rwbarton        |                Owner:  gmainland
            Type:  bug             |               Status:  new
        Priority:  highest         |            Milestone:  8.0.1
       Component:  Runtime System  |              Version:  8.0.1-rc1
      Resolution:                  |             Keywords:
Operating System:  Linux           |         Architecture:  arm
 Type of failure:  Runtime crash   |            Test Case:
      Blocked By:                  |             Blocking:
 Related Tickets:                  |  Differential Rev(s):
       Wiki Page:                  |
-----------------------------------+---------------------------------

Comment (by rwbarton):

 I think the reason that I only saw this bug with `-debug` is that the
 debug version of `stg_ap_ppp_fast` has extra code to print logging
 information when some debug flags are activated. This created enough
 register pressure that LLVM decided to rearrange some registers including
 `r8`, the ARM register that holds R2. Because `stg_ap_ppp_fast` invokes
 the function it calls with the R2 argument `undef`, once `r8` was
 clobbered, the invoked function saw the wrong value for R2, and a crash
 was inevitable.

 So here is a plan for testing for this bug, and others like it.

 * Add a flag `-fllvm-fill-undef-with-garbage`, and pass it when running
 validate.

 * In `Llvm.Types.ppLit`, if this flag is enabled, output `0xbbbbbbbb...`
 (of whatever size is needed) rather than `undef`.

 Then all LLVM builds should catch issues like this one.

 I can implement this if it sounds reasonable.

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


More information about the ghc-tickets mailing list