[GHC] #12433: GHCi produces incorrect results when evaluating with compiled code

GHC ghc-devs at haskell.org
Tue Jul 26 00:28:41 UTC 2016


#12433: GHCi produces incorrect results when evaluating with compiled code
-------------------------------------+-------------------------------------
        Reporter:  diatchki          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  ghci, dynamic
                                     |  linking, compiled code
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  Incorrect result  |  (amd64)
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 So, if the heap check should happen to fail, the R1 that is passed to
 `stg_gc_unbx_r1` is not actually the value returned by `$wcclass`, but
 rather some other value (the offset from the jump table start to the
 branch that was taken). Then when the GC finishes and returns to `c2s5`,
 it looks as though `$wcclass` returned that value, which causes the error
 you saw.

 I haven't looked at the code yet to determine who is at fault--maybe
 liveness calculation does not flow through `switch` statements properly,
 or maybe the NCG is clobbering registers that it isn't entitled to
 clobber.

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


More information about the ghc-tickets mailing list