Skip to content

signal (4): Illegal instruction, related to Julia 1.8 #47685

Closed
@dehann

Description

@dehann

Hi, tried to mention in a related and recently closed issue, but was likely missed. I'm still getting a similar Illegal instruction error on Julia 1.8.3 (after the #46882 fix).

The first line is the last printout to come from Julia-land before dropping down with the Signal (4) Illegal instruction:

WHAT IS GOING ON
Unreachable reached at 0x7f13965605ec

signal (4): Illegal instruction
in expression starting at REPL[10]:1
_writeG2oVertexes at /home/dehann/.julia/dev/RoME/src/services/g2oParser.jl:289
_jl_invoke at /home/dehann/software/julia/src/gf.c:2365 [inlined]
ijl_apply_generic at /home/dehann/software/julia/src/gf.c:2547
jl_apply at /home/dehann/software/julia/src/julia.h:1839 [inlined]
do_call at /home/dehann/software/julia/src/interpreter.c:126
eval_value at /home/dehann/software/julia/src/interpreter.c:215
eval_stmt_value at /home/dehann/software/julia/src/interpreter.c:166 [inlined]
eval_body at /home/dehann/software/julia/src/interpreter.c:612
jl_interpret_toplevel_thunk at /home/dehann/software/julia/src/interpreter.c:750
jl_toplevel_eval_flex at /home/dehann/software/julia/src/toplevel.c:906
jl_toplevel_eval_flex at /home/dehann/software/julia/src/toplevel.c:850
ijl_toplevel_eval_in at /home/dehann/software/julia/src/toplevel.c:965
eval at ./boot.jl:368 [inlined]
eval_user_input at /home/dehann/software/julia/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:151
repl_backend_loop at /home/dehann/software/julia/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:247
start_repl_backend at /home/dehann/software/julia/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:232
#run_repl#47 at /home/dehann/software/julia/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:369
run_repl at /home/dehann/software/julia/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:355
jfptr_run_repl_63686 at /home/dehann/software/julia/usr/lib/julia/sys.so (unknown line)
_jl_invoke at /home/dehann/software/julia/src/gf.c:2365 [inlined]
ijl_apply_generic at /home/dehann/software/julia/src/gf.c:2547
#967 at ./client.jl:419
jfptr_YY.967_57682 at /home/dehann/software/julia/usr/lib/julia/sys.so (unknown line)
_jl_invoke at /home/dehann/software/julia/src/gf.c:2365 [inlined]
ijl_apply_generic at /home/dehann/software/julia/src/gf.c:2547
jl_apply at /home/dehann/software/julia/src/julia.h:1839 [inlined]
jl_f__call_latest at /home/dehann/software/julia/src/builtins.c:774
#invokelatest#2 at ./essentials.jl:729 [inlined]
invokelatest at ./essentials.jl:726 [inlined]
run_main_repl at ./client.jl:404
exec_options at ./client.jl:318
_start at ./client.jl:522
jfptr__start_29970 at /home/dehann/software/julia/usr/lib/julia/sys.so (unknown line)
_jl_invoke at /home/dehann/software/julia/src/gf.c:2365 [inlined]
ijl_apply_generic at /home/dehann/software/julia/src/gf.c:2547
jl_apply at /home/dehann/software/julia/src/julia.h:1839 [inlined]
true_main at /home/dehann/software/julia/src/jlapi.c:575
jl_repl_entrypoint at /home/dehann/software/julia/src/jlapi.c:719
main at julia (unknown line)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at julia (unknown line)
Allocations: 166096316 (Pool: 166040379; Big: 55937); GC: 71
Illegal instruction (core dumped)

The code is a simple case of dispatch:

function _writeG2oLine(::Pose3, io, dfg::AbstractDFG, label, i, solveKey)
  println("WHAT IS GOING ON")
  return nothing
end

function _writeG2oVertexes(io,  dfg,  varIntLabel,  solveKey)
  for (label,i) in pairs(varIntLabel)
    vartype = getVariableType(dfg, label)
    _writeG2oLine(vartype, io, dfg, label, i, solveKey)
    println("NEVER SEEN")
  end
  return nothing
end

Notice how the inner function print statement runs, but then this big error on the return nothing statement. Execution never makes it to the later NEVER SEEN print line. I'm a little confused.


EDIT:

$ julia -O3
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.3 (2022-11-14)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

julia> versioninfo()
Julia Version 1.8.3
Commit 0434deb161 (2022-11-14 20:14 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 12 × Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 6 on 12 virtual cores
Environment:
  JULIA_NUM_THREADS = 6

Also note Julia v1.8.3 I'm using here is freshly compiled from source. I was hoping 1.8.3 would fix the issue, but doesn't seem like it.


EDIT2: this was actually quite a tiring exercise, and ended up going with the following workaround:

# dispatching to a function like this does not work in Julia 1.8 in this case:
somefnc(::MyType, args...) = ...

# using workaround
fixdfnc = getfield(MyModule, Symbol(:somefnc, typeof(mytype).name.name))
fixdfnc(args...)

Also, not sure if this is related, but I found another dispatch issue on Julia 1.8: when trying to add a dispatch from a downstream module, the multiple dispatch breaks down in some cases (used to work before 1.8). For example, module First fnc(::MyType) end; and then overloading fails: module Second import First.fnc; First.fnc(::AnotherType) end.

Originally posted by @dehann in #46871 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions