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

GHC ghc-devs at haskell.org
Mon May 25 02:16:45 UTC 2015


#10375: arm: ghci hits an illegal instruction
-------------------------------------+---------------------------------
        Reporter:  erikd             |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:  7.10.2
       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):

 Added a `static int count=0` variable that gets incremented each time the
 `schedule` function passes through the `ThreadRunGHC` case statement. I
 then added a printf:

 {{{
 printf ("%d : %u %u\n", count, cap->no, (unsigned)cap->r.rCurrentTSO->id);
 }}}

 and running it with the `getChar` in `.ghci` I note that the last set of
 values printed by this statement before it segfaults is:

 {{{
 183 : 0 22
 }}}

 So I run it again and attached GDB when the process is waiting for
 `getChar` and then set a breakpoint:

 {{{
 (gdb) break rts/Schedule.c:490 if (count == 183 && cap->no == 0 &&
 cap->r.rCurrentTSO->id == 22)
 }}}

 only to have the process crash in a completely different way:

 {{{
 Program received signal SIGILL, Illegal instruction.
 0xb2c56c7a in schedule (initialCapability=0xb2c96180 <MainCapability>,
 task=0x10faf8) at rts/Schedule.c:491

 (gdb) bt
 #0  0xb2c56c7a in schedule (initialCapability=0xb2c96180 <MainCapability>,
 task=0x10faf8) at rts/Schedule.c:491
 #1  0xb2c59040 in scheduleWaitThread (tso=0xb2707000, ret=0x0,
 pcap=0xbeffe944)
 at rts/Schedule.c:2408
 #2  0xb2c47c98 in rts_evalLazyIO (cap=0xbeffe944, p=0xd2c30
 <ZCMain_main_closure>, ret=0x0) at rts/RtsAPI.c:500
 #3  0xb2c5a0fc in real_main () at rts/RtsMain.c:63
 #4  0xb2c5a1d0 in hs_main (argc=3, argv=0xbeffeb04, main_closure=0xd2c30
 <ZCMain_main_closure>, rts_config=...) at rts/RtsMain.c:114
 #5  0x000cd2c6 in main ()

 (gdb) dis 0xb2c56c7a
 warning: bad breakpoint number at or near '0xb2c56c7a'

 }}}

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


More information about the ghc-tickets mailing list