[Openmcl-devel] Illegal Instruction in CCL 1.11.5 on Musl Libc

Will Sinatra wpsinatra at gmail.com
Tue Dec 17 13:00:12 PST 2019


Looking at the disassembly of remap_spjump I'm seeing:

(gdb) disass remap_spjump
Dump of assembler code for function remap_spjump:
Address range 0x415630 to 0x415676:
   0x0000000000415630 <+0>:     sub    $0x8,%rsp
   0x0000000000415634 <+4>:     xor    %r9d,%r9d
   0x0000000000415637 <+7>:     mov    $0xffffffff,%r8d
   0x000000000041563d <+13>:    mov    $0x32,%ecx
   0x0000000000415642 <+18>:    mov    $0x3,%edx
   0x0000000000415647 <+23>:    mov    $0x1000,%esi
   0x000000000041564c <+28>:    mov    $0x15000,%edi
   0x0000000000415651 <+33>:    callq  0x40d2e0 <mmap at plt>
   0x0000000000415656 <+38>:    cmp    $0xffffffffffffffff,%rax
   0x000000000041565a <+42>:    jne    0x40d6f4 <remap_spjump+4294934724>
   0x0000000000415660 <+48>:    lea    0x12ae2(%rip),%rdi        # 0x428149
   0x0000000000415667 <+55>:    callq  0x40d1c0 <perror at plt>
   0x000000000041566c <+60>:    mov    $0x1,%edi
   0x0000000000415671 <+65>:    callq  0x40d600 <_exit at plt>
Address range 0x40d6f4 to 0x40d6f6:
=> 0x000000000040d6f4 <+-32572>:        ud2
End of assembler dump.

And the registers are:

(gdb) info registers
rax            0x15000             86016
rbx            0x7fffffffeb68      140737488350056
rcx            0x7ffff7f9dbed      140737353735149
rdx            0x3                 3
rsi            0x1000              4096
rdi            0x15000             86016
rbp            0x1                 0x1
rsp            0x7fffffffeb10      0x7fffffffeb10
r8             0xffffffffffffffff  -1
r9             0x0                 0
r10            0x32                50
r11            0x246               582
r12            0x7fffffffeb68      140737488350056
r13            0x7fffffffeb78      140737488350072
r14            0x431ad0            4397776
r15            0x400000100003e00   288230380446694912
rip            0x40d6f4            0x40d6f4 <remap_spjump+4294934724>
eflags         0x10213             [ CF AF IF RF ]
cs             0x33                51
ss             0x2b                43
ds             0x0                 0
es             0x0                 0
fs             0x0                 0
gs             0x0                 0

I wish I was more familiar with C, most of this I'm only roughly
familiar with. I don't see anything that immediately jumps out as
problematic,  but maybe someone with a more seasoned eye would.

On Sun, Dec 15, 2019 at 10:17 AM Waldek Hebisch
<hebisch at math.uni.wroc.pl> wrote:
>
> Will Sinatra wrote:
> >
> > I'm trying to get CCL packaged for Alpine Linux, and have had some
> > success, but ended up hitting a bit of a wall.
> >
> > I'm able to get an lx86cl64 image to compile, however when I go to run
> > it I get an illegal instruction error, when I run the newly compiled
> > binary through gdb it provides:
> >
> > Program received signal SIGILL, Illegal instruction.
> > remap_spjump () at ../pmcl-kernel.c:1568
> > 1568      memmove(new, old, 0x1000);
>
> Wild guess: you may have misaligned data.  IME (with other programs)
> such error appear because C rules says that data is properly
> ligned and gcc calls optimized routine using SSE or AVX instructions.
>
> Easy to verify disassembling and looking at registers.
>
> --
>                               Waldek Hebisch
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list