[GHC] #10863: "hello world" produces illegal instruction error

GHC ghc-devs at haskell.org
Mon Sep 14 00:41:02 UTC 2015


#10863: "hello world" produces illegal instruction error
----------------------------------+---------------------------------
        Reporter:  Ansible        |                   Owner:
            Type:  bug            |                  Status:  new
        Priority:  normal         |               Milestone:
       Component:  Compiler       |                 Version:  7.10.2
      Resolution:                 |                Keywords:
Operating System:  Linux          |            Architecture:  arm
 Type of failure:  Runtime crash  |               Test Case:
      Blocked By:                 |                Blocking:
 Related Tickets:                 |  Differential Revisions:
----------------------------------+---------------------------------

Comment (by rwbarton):

 Ok so `main` is Thumb code (mixed 2- and 4-byte instructions) but it was
 called as ARM mode. The evidence is that the T bit (bit 5, `0x00000200`)
 in the CPSR is not set, and we are in the middle of a Thumb instruction
 `main+16`, presumably by managing to stumble through four 32-bit ARM
 instructions.

 I don't understand ''why'' `main` is Thumb code though. `main` is built
 from a C file with `gcc` when the executable is built. Could you attach
 the output of building your program with `ghc -v`? I assume `gcc` is not
 being invoked with `-mthumb`...

 Maybe a dumb question, but can you compile and run a simple C hello world
 program? If you run it in gdb and break on `main`, is it ARM code or Thumb
 code?

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


More information about the ghc-tickets mailing list