[GHC] #10375: arm: ghci hits an illegal instruction

GHC ghc-devs at haskell.org
Sat Sep 5 19:21:51 UTC 2015


#10375: arm: ghci hits an illegal instruction
-------------------------------------+---------------------------------
        Reporter:  erikd             |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  high              |               Milestone:  7.10.3
       Component:  GHCi              |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:  arm
 Type of failure:  GHCi crash        |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+---------------------------------

Comment (by erikd):

 Things to note:

 * Register `R0` is the argument/result/scratch register.
 * `stg_ap_v_fast` is generated CMM code generated by `utils/genapply`.
 * Since this is on Arm, the CMM code is passed throught the LLVM backend.

 Confirming that we are actually generating invalid Arm assembly:

 {{{
 utils/genapply/dist/build/tmp/genapply > suspect.cmm
 inplace/bin/ghc-stage2 -Irts -c suspect.cmm -o suspect.o
 }}}

 and then `objdump -D suspect.o` and searching for `stg-ap_v_fast` results
 in:

 {{{
 0000853c <stg_ap_v_fast>:
     853c:       b480            push    {r7}
     853e:       b087            sub     sp, #28
     8540:       af00            add     r7, sp, #0
     8542:       4b76            ldr     r3, [pc, #472]  ; (871c
 <stg_ap_v_fast+0x1e0>)
     8544:       681b            ldr     r3, [r3, #0]
 }}}

 which is exactly what we found in GDB.

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


More information about the ghc-tickets mailing list