<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Lang,</div><div class=""><br class=""></div><div class="">Thanks for fixing it. On i386-freebsd, the OrcLazy tests now all succeed:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">-- Testing: 4 tests, 4 threads --</font></div><div class=""><font face="Menlo" class="">PASS: LLVM :: ExecutionEngine/OrcLazy/anonymous_globals.ll (1 of 4)</font></div><div class=""><font face="Menlo" class="">PASS: LLVM :: ExecutionEngine/OrcLazy/hello.ll (2 of 4)</font></div><div class=""><font face="Menlo" class="">PASS: LLVM :: ExecutionEngine/OrcLazy/private_linkage.ll (3 of 4)</font></div><div class=""><font face="Menlo" class="">PASS: LLVM :: ExecutionEngine/OrcLazy/global_aliases.ll (4 of 4)</font></div><div class=""><font face="Menlo" class="">Testing Time: 0.10s</font></div><div class=""><font face="Menlo" class=""> Expected Passes : 4</font></div></div><div class=""><br class=""></div><div class="">-Dimitry</div><br class=""><div><blockquote type="cite" class=""><div class="">On 21 Feb 2016, at 23:57, Lang Hames <<a href="mailto:lhames@gmail.com" class="">lhames@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Dimitry, Reid,<div class=""><br class=""></div><div class="">I've added stack realignment code to the i386 resolver function in r261503. This should fix the failures due to the fxsave/fxrstor instructions. Hopefully this will fix the BSD bots.</div><div class=""><br class=""></div><div class="">Reid - this doesn't address the relocation issue you encountered, so we can't turn these tests back on on Windows yet, but it's a step in the right direction.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Lang.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, Feb 21, 2016 at 12:20 PM, Lang Hames <span dir="ltr" class=""><<a href="mailto:lhames@gmail.com" target="_blank" class="">lhames@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi Dimitry,<div class=""><br class=""></div><div class="">This looks similar to the issue that Reid ran in to. I suspect it's a stack alignment issue: This code assumes the stack is 16-byte aligned, and I guess that's not true on Windows or BSD.</div><div class=""><br class=""></div><div class="">I'll add some stack realignment code now and see if it gets the builders green again.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Lang.</div><div class=""><br class=""></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, Feb 21, 2016 at 5:42 AM, Dimitry Andric <span dir="ltr" class=""><<a href="mailto:dimitry@andric.com" target="_blank" class="">dimitry@andric.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10 Feb 2016, at 02:02, Lang Hames via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class="">
><br class="">
> Author: lhames<br class="">
> Date: Tue Feb 9 19:02:33 2016<br class="">
> New Revision: 260338<br class="">
><br class="">
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=260338&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=260338&view=rev</a><br class="">
> Log:<br class="">
> [Orc] Add lazy-JITting support for i386.<br class="">
><br class="">
> This patch adds a new class, OrcI386, which contains the hooks needed to<br class="">
> support lazy-JITing on i386 (currently only for Pentium 2 or above, as the JIT<br class="">
> re-entry code uses the FXSAVE/FXRSTOR instructions).<br class="">
><br class="">
> Support for i386 is enabled in the LLI lazy JIT and the Orc C API, and<br class="">
> regression and unit tests are enabled for this architecture.<br class="">
<br class="">
</span>Hi,<br class="">
<br class="">
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. :)<br class="">
<br class="">
All the OrcLazy tests result in lli getting a SIGBUS:<br class="">
<br class="">
FAIL: LLVM :: ExecutionEngine/OrcLazy/anonymous_globals.ll (18054 of 25776)<br class="">
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/anonymous_globals.ll' FAILED ********************<br class="">
Script:<br class="">
--<br class="">
/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<br class="">
--<br class="">
Exit Code: 138<br class="">
<br class="">
Command Output (stderr):<br class="">
--<br class="">
/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<br class="">
<br class="">
--<br class="">
<br class="">
********************<br class="">
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60..<br class="">
FAIL: LLVM :: ExecutionEngine/OrcLazy/global_aliases.ll (18064 of 25776)<br class="">
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/global_aliases.ll' FAILED ********************<br class="">
Script:<br class="">
--<br class="">
/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<br class="">
--<br class="">
Exit Code: 138<br class="">
<br class="">
Command Output (stderr):<br class="">
--<br class="">
/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<br class="">
<br class="">
--<br class="">
<br class="">
********************<br class="">
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60..<br class="">
FAIL: LLVM :: ExecutionEngine/OrcLazy/hello.ll (18077 of 25776)<br class="">
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/hello.ll' FAILED ********************<br class="">
Script:<br class="">
--<br class="">
/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<br class="">
--<br class="">
Exit Code: 2<br class="">
<br class="">
Command Output (stderr):<br class="">
--<br class="">
FileCheck error: '-' is empty.<br class="">
<br class="">
--<br class="">
<br class="">
********************<br class="">
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60..<br class="">
FAIL: LLVM :: ExecutionEngine/OrcLazy/private_linkage.ll (18078 of 25776)<br class="">
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/private_linkage.ll' FAILED ********************<br class="">
Script:<br class="">
--<br class="">
/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<br class="">
--<br class="">
Exit Code: 138<br class="">
<br class="">
Command Output (stderr):<br class="">
--<br class="">
/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<br class="">
<br class="">
--<br class="">
<br class="">
********************<br class="">
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.<br class="">
FAIL: LLVM-Unit :: ExecutionEngine/Orc/OrcJITTests/OrcCAPIExecutionTest.TestLazyIRCompilation (24756 of 25776)<br class="">
******************** TEST 'LLVM-Unit :: ExecutionEngine/Orc/OrcJITTests/OrcCAPIExecutionTest.TestLazyIRCompilation' FAILED ********************<br class="">
Note: Google Test filter = OrcCAPIExecutionTest.TestLazyIRCompilation<br class="">
[==========] Running 1 test from 1 test case.<br class="">
[----------] Global test environment set-up.<br class="">
[----------] 1 test from OrcCAPIExecutionTest<br class="">
[ RUN ] OrcCAPIExecutionTest.TestLazyIRCompilation<br class="">
<br class="">
********************<br class="">
<br class="">
Unfortunately, the debugger seems to have trouble following the execution, so it does not really show anything interesting in the stack trace:<br class="">
<br class="">
(gdb) run<br class="">
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<br class="">
[New Thread 29612000 (LWP 101099)]<br class="">
<br class="">
Program received signal SIGBUS, Bus error.<br class="">
[Switching to Thread 29612000 (LWP 101099)]<br class="">
0x28fa600f in ?? ()<br class="">
(gdb) bt<br class="">
#0 0x28fa600f in ?? ()<br class="">
#1 0x2913aff5 in ?? ()<br class="">
#2 0x0815adcd in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)<br class="">
at /share/dim/src/llvm/trunk/tools/lli/lli.cpp:414<br class="">
<br class="">
It appears to die on an fxsave instruction, though:<br class="">
<br class="">
(gdb) disassemble 0x28fa6000,0x28fa6020<br class="">
Dump of assembler code from 0x28fa6000 to 0x28fa6020:<br class="">
0x28fa6000: push %ebp<br class="">
0x28fa6001: mov %esp,%ebp<br class="">
0x28fa6003: push %eax<br class="">
0x28fa6004: push %ebx<br class="">
0x28fa6005: push %ecx<br class="">
0x28fa6006: push %edx<br class="">
0x28fa6007: push %esi<br class="">
0x28fa6008: push %edi<br class="">
0x28fa6009: sub $0x21c,%esp<br class="">
=> 0x28fa600f: fxsave 0x10(%esp)<br class="">
0x28fa6014: mov 0x4(%ebp),%esi<br class="">
0x28fa6017: sub $0x5,%esi<br class="">
0x28fa601a: mov %esi,0x4(%esp)<br class="">
0x28fa601e: movl $0x296182c0,(%esp)<br class="">
End of assembler dump.<br class="">
(gdb) info registers<br class="">
eax 0xbfbfe6e0 -1077942560<br class="">
ecx 0x2913bff0 689160176<br class="">
edx 0x3 3<br class="">
ebx 0x905e994 151382420<br class="">
esp 0xbfbfd58c 0xbfbfd58c<br class="">
ebp 0xbfbfd7c0 0xbfbfd7c0<br class="">
esi 0xbfbfd7f0 -1077946384<br class="">
edi 0xbfbfd820 -1077946336<br class="">
eip 0x28fa600f 0x28fa600f<br class="">
eflags 0x210292 [ AF SF IF RF ID ]<br class="">
cs 0x33 51<br class="">
ss 0x3b 59<br class="">
ds 0x3b 59<br class="">
es 0x3b 59<br class="">
fs 0x3b 59<br class="">
gs 0x1b 27<br class="">
<br class="">
Any ideas on how to debug this further?<br class="">
<span class=""><font color="#888888" class=""><br class="">
-Dimitry<br class="">
<br class="">
</font></span></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>