Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Illegal Instruction - kf/gallium branch Unbuntu 14.04 #28

Closed
mdcfrancis opened this issue Sep 14, 2015 · 14 comments
Closed

Illegal Instruction - kf/gallium branch Unbuntu 14.04 #28

mdcfrancis opened this issue Sep 14, 2015 · 14 comments

Comments

@mdcfrancis
Copy link
Collaborator

It looks like something has gone off the rails on a clean build, any pointers before I start looking?

Copying in usr/share/doc/julia/examples
JULIA usr/lib/julia/inference0.ji
Illegal instruction (core dumped)
make[1]: *** [/home/michael/src/gallium/usr/lib/julia/inference0.ji] Error 132

@ihnorton
Copy link
Contributor

Is this a fresh-checkout? I did a fresh-checkout build on Friday, which worked fine (also on ubuntu 14.04). As far as I can tell nothing has changed on the julia, llvm, or lldb kf/gallium branches since then.

(cc @malmaud who also saw this on ubuntu 14.04.)

@mdcfrancis
Copy link
Collaborator Author

Yes I started from a entirely new area. The build looked clean up until then, I'm running under a VM but I don't expect that to have an impact.

@malmaud
Copy link

malmaud commented Sep 14, 2015

I was actually also running under a VM.

On Mon, Sep 14, 2015 at 10:56 AM, mdcfrancis [email protected]
wrote:

Yes I started from a entirely new area. The build looked clean up until
then, I'm running under a VM but I don't expect that to have an impact.


Reply to this email directly or view it on GitHub
#28 (comment).

@ihnorton
Copy link
Contributor

Running under a VM is an extremely relevant detail when you see an illegal instruction 😃

@mdcfrancis
Copy link
Collaborator Author

(gdb) bt full
#0 0x00002b860fde4031 in ?? ()
No symbol table info available.
#1 0x00007ffd7ec724e0 in ?? ()
No symbol table info available.
#2 0x0000000000000010 in ?? ()
No symbol table info available.
#3 0x00007ffd7ec720b0 in ?? ()
No symbol table info available.
#4 0x00002b86150a6910 in ?? ()
No symbol table info available.
#5 0x00002b8615088010 in ?? ()
No symbol table info available.
#6 0x00007ffd7ec72128 in ?? ()
No symbol table info available.
#7 0x0000000000000002 in ?? ()
No symbol table info available.
#8 0x00002b86150ae470 in ?? ()
No symbol table info available.
#9 0x00007ffd7ec72070 in ?? ()
No symbol table info available.
#10 0x00002b8610048561 in jl_trampoline_compile_function (sig=0x2b86150a6890, always_infer=0, f=0x7ffd7ec72128)
at builtins.c:1013
No locals.
#11 jl_trampoline (F=0x7ffd7ec72128, args=0x2, nargs=353015760) at builtins.c:1024
f = 0x7ffd7ec72128
#12 0x00002b861009b8c3 in jl_apply (nargs=2, args=0x7ffd7ec72128, f=0x2b86150a6890) at julia.h:1291
No locals.
#13 do_call (f=f@entry=0x2b86150a6890, args=args@entry=0x2b86150ae568, nargs=nargs@entry=2, eval0=eval0@entry=0x0,
locals=locals@entry=0x0, nl=nl@entry=0, ngensym=ngensym@entry=0) at interpreter.c:65
argv = 0x7ffd7ec72120
i = 2
#14 0x00002b861009ace1 in eval (e=, locals=locals@entry=0x0, nl=nl@entry=0, ngensym=ngensym@entry=0)
at interpreter.c:213
f = 0x2b86150a6890
ex =
args = 0x2b86150ae560
nargs = 3
#15 0x00002b861009b7eb in jl_interpret_toplevel_expr (e=) at interpreter.c:27
No locals.
#16 0x00002b86100af998 in jl_toplevel_eval_flex (e=, fast=fast@entry=1) at toplevel.c:527
---Type to continue, or q to quit---
ex = 0x2b86150a68d0
thunk = 0x0
result =
thk = 0x0
ewc = 0
__gc_stkf = {0x7, 0x7ffd7ec724b0, 0x7ffd7ec723c0, 0x7ffd7ec723d0, 0x7ffd7ec723b0}
head = 0x2b860fe6efe8
#17 0x00002b86100b0689 in jl_toplevel_eval_flex (fast=1, e=) at toplevel.c:573
No locals.
#18 jl_parse_eval_all (fname=fname@entry=0x2b86101065b1 "boot.jl", len=len@entry=8) at toplevel.c:577
last_lineno = 0
last_filename = 0x2b86100feb66 "no file"
fn = 0x0
ln = 0x0
form = 0x2b86150a68b0
result = 0x2b86150a6890
__gc_stkf = {0x9, 0x0, 0x7ffd7ec72470, 0x7ffd7ec72480, 0x7ffd7ec72490, 0x7ffd7ec724a0}
i__tr =
i__ca =
__eh = {eh_ctx = {{__jmpbuf = {140726730433760, -1682805486869295234, 8, 47854798123072, 1, 47854798123072,
-1682805486852518018, 4635229633792167806}, __mask_was_saved = 0, __saved_mask = {__val = {47854794884152,
262144, 47854794884711, 16, 140726730433984, 140726730433888, 47854792422040, 4294967296, 47854794932059,
47854868250149, 0, 0, 11, 47854868250149, 140726730434000, 8}}}}, gcstack = 0x7ffd7ec724b0, prev = 0x0}
#19 0x00002b86100b08c5 in jl_load (fname=fname@entry=0x2b86101065b1 "boot.jl", len=len@entry=8) at toplevel.c:617
fpath = 0x2b86101065b1 "boot.jl"
stbuf = {st_dev = 2049, st_mode = 33204, st_nlink = 1, st_uid = 1000, st_gid = 1000, st_rdev = 0, st_ino = 1579033,
st_size = 8172, st_blksize = 4096, st_blocks = 16, st_flags = 0, st_gen = 0, st_atim = {tv_sec = 1442234452,
tv_nsec = 309433321}, st_mtim = {tv_sec = 1442234281, tv_nsec = 773428277}, st_ctim = {tv_sec = 1442234281,
tv_nsec = 773428277}, st_birthtim = {tv_sec = 1442234281, tv_nsec = 773428277}}
result =
#20 0x00002b86100a1237 in _julia_init (rel=JL_IMAGE_JULIA_HOME) at init.c:549
total_mem =
i =
table =
#21 0x00002b86100a187d in julia_init (rel=) at task.c:260
__stk = 0 '\000'
#22 0x0000000000401633 in main (argc=1, argv=0x7ffd7ec72938) at repl.c:582
ret =

@ihnorton
Copy link
Contributor

Could you post disassemble output at that point to see what the instruction was? If it is an extension, the easiest (temporary) fix will probably be to disable that mode in codegen initialization.

Also this should probably be filed on the Julia repo itself since it is a codegen issue.

@mdcfrancis
Copy link
Collaborator Author

(gdb) disassemble 0x00002b860fde4031-16, 0x00002b860fde4031+16
Dump of assembler code from 0x2b860fde4021 to 0x2b860fde4041:
   0x00002b860fde4021:  mov    (%rcx),%rax
   0x00002b860fde4024:  mov    %rax,0x10(%rsp)
   0x00002b860fde4029:  lea    0x8(%rsp),%rax
   0x00002b860fde402e:  mov    %rax,(%rcx)
=> 0x00002b860fde4031:  vxorps %ymm0,%ymm0,%ymm0
   0x00002b860fde4035:  vmovups %ymm0,0x18(%rsp)
   0x00002b860fde403b:  lea    0x30(%rsp),%r13
   0x00002b860fde4040:  lea    0x38(%rsp),%rbx

@Keno
Copy link
Member

Keno commented Sep 14, 2015

Do you have LLVM assertions enabled?

@mdcfrancis
Copy link
Collaborator Author

Yes in Make.user, from your branch.

@mdcfrancis
Copy link
Collaborator Author

Looks like codegen is inserting an AVX instruction, Virtual Box ( where I'm running this ) does not support it.

@ihnorton
Copy link
Contributor

@mdcfrancis
Copy link
Collaborator Author

That didn't help but add -avx in that block allows the code to run, so disable avx

@mdcfrancis
Copy link
Collaborator Author

diff --git a/src/codegen.cpp b/src/codegen.cpp
index 24b154c..1d6e8ca 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -5980,7 +5980,9 @@ extern "C" void jl_init_codegen(void)
 #if defined(_CPU_X86_64_) || defined(_CPU_X86_)
 #ifndef USE_MCJIT
         // Temporarily disable Haswell BMI2 features due to LLVM bug.
        "-bmi2", "-avx2",
+#else
+       "-avx"
 #endif
 #ifdef V128_BUG
         "-avx",

@Keno
Copy link
Member

Keno commented Sep 26, 2015

Closing here as this is a julia/llvm issue.

@Keno Keno closed this as completed Sep 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants