|
From: | David Meyer |
Subject: | [Libjit] Miscompilation problem |
Date: | Mon, 8 Jan 2018 13:39:53 +0000 |
I’ve been encountering this sporadically for several weeks. I finally have an isolated example (attached, minimal.c). It will attempt to reproduce the miscompilation. There is some trial and error involved, since it requires triggering
an out-of-memory compile restart at just the right time. When it detects a miscompile, it dumps the corresponding object code to /tmp/minimal.dump. Here is what it looks like when it miscompiles: 7ffff7fb4030: 48 8b ec mov %rsp,%rbp 7ffff7fb4033: 48 83 ec 30 sub $0x30,%rsp 7ffff7fb4037: 4c 89 34 24 mov %r14,(%rsp) 7ffff7fb403b: 4c 89 7c 24 08 mov %r15,0x8(%rsp) 7ffff7fb4040: 4c 8b f7 mov %rdi,%r14 7ffff7fb4043: 89 75 f8 mov %esi,-0x8(%rbp) 7ffff7fb4046: 89 55 f0 mov %edx,-0x10(%rbp) 7ffff7fb4049: e9 78 78 00 00 jmpq 0x7ffff7fbb8c6 7ffff7fb404e: 44 8b 7d e8 mov -0x18(%rbp),%r15d <<<<<<<<<< 7ffff7fb4052: 41 83 c7 00 add $0x0,%r15d 7ffff7fb4056: e9 7b 78 00 00 jmpq 0x7ffff7fbb8d6 ... large dummy jumptable section... 7ffff7fbb8c6: 45 8b fe mov %r14d,%r15d 7ffff7fbb8c9: 44 03 7d f8 add -0x8(%rbp),%r15d 7ffff7fbb8cd: 44 03 7d f0 add -0x10(%rbp),%r15d 7ffff7fbb8d1: e9 78 87 ff ff jmpq 0x7ffff7fb404e 7ffff7fbb8d6: 41 83 fe 64 cmp $0x64,%r14d 7ffff7fbb8da: 0f 84 7b 87 ff ff je 0x7ffff7fb405b 7ffff7fbb8e0: 41 8b c7 mov %r15d,%eax 7ffff7fbb8e3: 4c 8b 34 24 mov (%rsp),%r14 7ffff7fbb8e7: 4c 8b 7c 24 08 mov 0x8(%rsp),%r15 7ffff7fbb8ec: 48 8b e5 mov %rbp,%rsp 7ffff7fbb8ef: 5d pop %rbp 7ffff7fbb8f0: c3 retq
|
minimal.c
Description: minimal.c
[Prev in Thread] | Current Thread | [Next in Thread] |