[llvm] r260338 - [Orc] Add lazy-JITting support for i386.

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 21 05:42:31 PST 2016


On 10 Feb 2016, at 02:02, Lang Hames via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: lhames
> Date: Tue Feb  9 19:02:33 2016
> New Revision: 260338
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=260338&view=rev
> Log:
> [Orc] Add lazy-JITting support for i386.
> 
> This patch adds a new class, OrcI386, which contains the hooks needed to
> support lazy-JITing on i386 (currently only for Pentium 2 or above, as the JIT
> re-entry code uses the FXSAVE/FXRSTOR instructions).
> 
> Support for i386 is enabled in the LLI lazy JIT and the Orc C API, and
> regression and unit tests are enabled for this architecture.

Hi,

I was wondering why I was always getting OrcLazy test failures on i386-freebsd recently, but it appears to have been introduced with this commit. :)

All the OrcLazy tests result in lli getting a SIGBUS:

FAIL: LLVM :: ExecutionEngine/OrcLazy/anonymous_globals.ll (18054 of 25776)
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/anonymous_globals.ll' FAILED ********************
Script:
--
/home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/./bin/lli -jit-kind=orc-lazy /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/anonymous_globals.ll
--
Exit Code: 138

Command Output (stderr):
--
/home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/test/ExecutionEngine/OrcLazy/Output/anonymous_globals.ll.script: line 1: 11213 Bus error               (core dumped) /home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/./bin/lli -jit-kind=orc-lazy /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/anonymous_globals.ll

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60..
FAIL: LLVM :: ExecutionEngine/OrcLazy/global_aliases.ll (18064 of 25776)
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/global_aliases.ll' FAILED ********************
Script:
--
/home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/./bin/lli -jit-kind=orc-lazy /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/global_aliases.ll
--
Exit Code: 138

Command Output (stderr):
--
/home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/test/ExecutionEngine/OrcLazy/Output/global_aliases.ll.script: line 1: 11214 Bus error               (core dumped) /home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/./bin/lli -jit-kind=orc-lazy /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/global_aliases.ll

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60..
FAIL: LLVM :: ExecutionEngine/OrcLazy/hello.ll (18077 of 25776)
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/hello.ll' FAILED ********************
Script:
--
/home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/./bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/hello.ll | /home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/./bin/FileCheck /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/hello.ll
--
Exit Code: 2

Command Output (stderr):
--
FileCheck error: '-' is empty.

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60..
FAIL: LLVM :: ExecutionEngine/OrcLazy/private_linkage.ll (18078 of 25776)
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/private_linkage.ll' FAILED ********************
Script:
--
/home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/./bin/lli -jit-kind=orc-lazy /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/private_linkage.ll
--
Exit Code: 138

Command Output (stderr):
--
/home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/test/ExecutionEngine/OrcLazy/Output/private_linkage.ll.script: line 1: 11218 Bus error               (core dumped) /home/dim/obj/llvm-261275M-trunk-freebsd11-i386-ninja-rel-1/./bin/lli -jit-kind=orc-lazy /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/private_linkage.ll

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
FAIL: LLVM-Unit :: ExecutionEngine/Orc/OrcJITTests/OrcCAPIExecutionTest.TestLazyIRCompilation (24756 of 25776)
******************** TEST 'LLVM-Unit :: ExecutionEngine/Orc/OrcJITTests/OrcCAPIExecutionTest.TestLazyIRCompilation' FAILED ********************
Note: Google Test filter = OrcCAPIExecutionTest.TestLazyIRCompilation
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from OrcCAPIExecutionTest
[ RUN      ] OrcCAPIExecutionTest.TestLazyIRCompilation

********************

Unfortunately, the debugger seems to have trouble following the execution, so it does not really show anything interesting in the stack trace:

(gdb) run
Starting program: /home/dim/obj/llvm-orc-r260338/bin/lli -jit-kind=orc-lazy /share/dim/src/llvm/trunk/test/ExecutionEngine/OrcLazy/private_linkage.ll
[New Thread 29612000 (LWP 101099)]

Program received signal SIGBUS, Bus error.
[Switching to Thread 29612000 (LWP 101099)]
0x28fa600f in ?? ()
(gdb) bt
#0  0x28fa600f in ?? ()
#1  0x2913aff5 in ?? ()
#2  0x0815adcd in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
    at /share/dim/src/llvm/trunk/tools/lli/lli.cpp:414

It appears to die on an fxsave instruction, though:

(gdb) disassemble 0x28fa6000,0x28fa6020
Dump of assembler code from 0x28fa6000 to 0x28fa6020:
   0x28fa6000:  push   %ebp
   0x28fa6001:  mov    %esp,%ebp
   0x28fa6003:  push   %eax
   0x28fa6004:  push   %ebx
   0x28fa6005:  push   %ecx
   0x28fa6006:  push   %edx
   0x28fa6007:  push   %esi
   0x28fa6008:  push   %edi
   0x28fa6009:  sub    $0x21c,%esp
=> 0x28fa600f:  fxsave 0x10(%esp)
   0x28fa6014:  mov    0x4(%ebp),%esi
   0x28fa6017:  sub    $0x5,%esi
   0x28fa601a:  mov    %esi,0x4(%esp)
   0x28fa601e:  movl   $0x296182c0,(%esp)
End of assembler dump.
(gdb) info registers
eax            0xbfbfe6e0       -1077942560
ecx            0x2913bff0       689160176
edx            0x3      3
ebx            0x905e994        151382420
esp            0xbfbfd58c       0xbfbfd58c
ebp            0xbfbfd7c0       0xbfbfd7c0
esi            0xbfbfd7f0       -1077946384
edi            0xbfbfd820       -1077946336
eip            0x28fa600f       0x28fa600f
eflags         0x210292 [ AF SF IF RF ID ]
cs             0x33     51
ss             0x3b     59
ds             0x3b     59
es             0x3b     59
fs             0x3b     59
gs             0x1b     27

Any ideas on how to debug this further?

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160221/91b85712/attachment.sig>


More information about the llvm-commits mailing list