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

GHC ghc-devs at haskell.org
Mon Sep 14 03:23:23 UTC 2015


#10375: arm: ghci hits an illegal instruction
-------------------------------------+-------------------------------------
        Reporter:  erikd             |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  high              |               Milestone:  7.10.3
       Component:  Runtime System    |                 Version:  7.10.1
  (Linker)                           |
      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):

 Since I know that this is some problem with the function `hSetBuffering`
 when it is being loaded by the runtime linker I added a printf to
 `rts/Linker.c` to print the address of the `hSetBuffering` related
 functions when they are loaded. Running this now looks like:

 {{{
 $ inplace/bin/ghc-stage2 --interactive
 GHCi, version 7.11.20150912: http://www.haskell.org/ghc/  :? for help
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_entry is
 0xb3f3d3cd
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_entry is
 0xb3f3d3cd
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_info is
 0xb421f738
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_closure is
 0xb421d5b0
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering_entry is
 0xb3f3d471
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering_info is
 0xb421f718
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_entry is
 0xb3f3d3cd
 turnOffBuffering start
 turnOffBuffering middle
 Illegal instruction
 }}}

 If I now load this into gdb, run it until it crashes I get:

 {{{
 GHCi, version 7.11.20150912: http://www.haskell.org/ghc/  :? for help
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_entry is
 0xb3f503cd
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_entry is
 0xb3f503cd
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_info is
 0xb4232738
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_closure is
 0xb42305b0
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering_entry is
 0xb3f50471
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering_info is
 0xb4232718
 lookupSymbol: value of base_GHCziIOziHandle_hSetBuffering1_entry is
 0xb3f503cd
 turnOffBuffering start
 turnOffBuffering middle

 Program received signal SIGILL, Illegal instruction.
 0x04004e5c in stg_ap_v_fast ()
 (gdb) disass base_GHCziIOziHandle_hSetBuffering1_entry
 Dump of assembler code for function
 base_GHCziIOziHandle_hSetBuffering1_entry:
    0x03d423c4 <+0>:     movw    r3, #58688      ; 0xe540
    0x03d423c8 <+4>:     movt    r3, #1181       ; 0x49d
    0x03d423cc <+8>:     ldr.w   r2, [r3, #808]  ; 0x328
    0x03d423d0 <+12>:    subs    r2, #4
 }}}

 For some reason, the address of
 `base_GHCziIOziHandle_hSetBuffering1_entry` in GDB is not the address
 printed by the runtime linker.

 Even more confusingly, disassembling the address the `0xb3f3d3cd` fails,
 possibly because its outside the memory map.

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


More information about the ghc-tickets mailing list