Matthew Flatt <mfl...@cs.utah.edu> writes:

> Since the build log says "illegal instruction", what instruction is it
> trying to execute? Since there's so much variation in supported ARM
> instructions, maybe Racket's JIT is trying to use one not supported by
> the machine. Or maybe execution has just jumped to a bad place, such as
> the middle of an instruction.
>
> In gdb, you should be able to use `disassemble` in the vicinity of the
> address where Racket crashes (like 0xb6ea3254), but you may need to use
>

I tried both modes, at least to my inexpert eye they look the same.

The hardware claims to be arm v7 (Freescale i.MX53). 

(gdb)  set arm fallback-mode arm
(gdb) disassemble
Dump of assembler code for function malloc_stats:
   0xb6ea324c <+0>:     ldr     r1, [pc, #328]  ; (0xb6ea3398 
<malloc_stats+332>)
   0xb6ea324e <+2>:     ldr     r2, [pc, #332]  ; (0xb6ea339c 
<malloc_stats+336>)
   0xb6ea3250 <+4>:     add     r1, pc
   0xb6ea3252 <+6>:     ldr     r3, [pc, #332]  ; (0xb6ea33a0 
<malloc_stats+340>)
=> 0xb6ea3254 <+8>:     stmdb   sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
   0xb6ea3258 <+12>:    add     r3, pc
   0xb6ea325a <+14>:    ldr     r2, [r1, r2]
   0xb6ea325c <+16>:    sub     sp, #60 ; 0x3c
   0xb6ea325e <+18>:    ldr     r5, [pc, #324]  ; (0xb6ea33a4 
<malloc_stats+344>)
   0xb6ea3260 <+20>:    ldr     r2, [r2, #0]
   0xb6ea3262 <+22>:    str     r2, [sp, #52]   ; 0x34
   0xb6ea3264 <+24>:    mov.w   r2, #0
   0xb6ea3268 <+28>:    ldr     r2, [r3, #64]   ; 0x40
   0xb6ea326a <+30>:    add     r5, pc
   0xb6ea326c <+32>:    ldr     r7, [r3, #36]   ; 0x24
   0xb6ea326e <+34>:    cmp     r2, #0
   0xb6ea3270 <+36>:    blt.w   0xb6ea338c <malloc_stats+320>
   0xb6ea3274 <+40>:    ldr     r3, [pc, #304]  ; (0xb6ea33a8 
<malloc_stats+348>)
   0xb6ea3276 <+42>:    add.w   r9, sp, #12
   0xb6ea327a <+46>:    ldr     r4, [pc, #304]  ; (0xb6ea33ac 
<malloc_stats+352>)
   0xb6ea327c <+48>:    movs    r6, #0
   0xb6ea327e <+50>:    Cannot access memory at address 0xb6ea327e
(gdb)  set arm fallback-mode thumb
(gdb) disassemble
Dump of assembler code for function malloc_stats:
   0xb6ea324c <+0>:     ldr     r1, [pc, #328]  ; (0xb6ea3398 
<malloc_stats+332>)
   0xb6ea324e <+2>:     ldr     r2, [pc, #332]  ; (0xb6ea339c 
<malloc_stats+336>)
   0xb6ea3250 <+4>:     add     r1, pc
   0xb6ea3252 <+6>:     ldr     r3, [pc, #332]  ; (0xb6ea33a0 
<malloc_stats+340>)
=> 0xb6ea3254 <+8>:     stmdb   sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
   0xb6ea3258 <+12>:    add     r3, pc
   0xb6ea325a <+14>:    ldr     r2, [r1, r2]
   0xb6ea325c <+16>:    sub     sp, #60 ; 0x3c
   0xb6ea325e <+18>:    ldr     r5, [pc, #324]  ; (0xb6ea33a4 
<malloc_stats+344>)
   0xb6ea3260 <+20>:    ldr     r2, [r2, #0]
   0xb6ea3262 <+22>:    str     r2, [sp, #52]   ; 0x34
   0xb6ea3264 <+24>:    mov.w   r2, #0
   0xb6ea3268 <+28>:    ldr     r2, [r3, #64]   ; 0x40
   0xb6ea326a <+30>:    add     r5, pc
   0xb6ea326c <+32>:    ldr     r7, [r3, #36]   ; 0x24
   0xb6ea326e <+34>:    cmp     r2, #0
   0xb6ea3270 <+36>:    blt.w   0xb6ea338c <malloc_stats+320>
   0xb6ea3274 <+40>:    ldr     r3, [pc, #304]  ; (0xb6ea33a8 
<malloc_stats+348>)
   0xb6ea3276 <+42>:    add.w   r9, sp, #12
   0xb6ea327a <+46>:    ldr     r4, [pc, #304]  ; (0xb6ea33ac 
<malloc_stats+352>)
   0xb6ea327c <+48>:    movs    r6, #0
   0xb6ea327e <+50>:    Cannot access memory at address 0xb6ea327e
(gdb) 

Reply via email to