Skip to content

Unreachable reached #31496

@englhardt

Description

@englhardt

I am running into a unreachable error when executing the following script bug.jl.
This issue seems similar to #31439 and #31406. However in my case, only Julia 1.0.3 works correctly, and the bug already appears with Julia 1.1.0 and also fails on the latest nightly 1.2.0-DEV.557 (Commit 8649af9abe). This is different from the bug in #31439 that works with 1.1.0 and only fails on 1.2.0-DEV

bug.jl

using GaussianMixtures

struct GMMWrapper
    gmm::GMM
end

function sample_gmm(g::GMMWrapper, n::Int)
    return rand(g.gmm, n)
end

g = GMMWrapper(rand(GMM, 1, 2))

# works
@show rand(g.gmm, 10)
# fails
@show sample_gmm(g, 10)

Output:

rand(g.gmm, 10) = [-2.1182340176250976 1.630642305577004; -1.5943359590743922 0.026937477698993795; -2.022431014003848 2.3052428001268304; -1.2051696749634346 0.7670988215906123; -2.2556905707970296 1.4146400755937694; 0.05866609286796365 -0.45946366339887723; -1.5514045527686888 1.4352168554403033; -2.1021557548997785 -0.2619369172736933; -0.58429883008154 -0.3474937399220318; -4.191643913606173 3.6064676997298957]
Unreachable reached at 0x7f5d4dec3eb4

signal (4): Illegal instruction
in expression starting at xxxxx/bug.jl:19
sample_gmm at xxxxx/bug.jl:11
unknown function (ip: 0x7f5d4dec3ed7)
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1871
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2226
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:323
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:411
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:362 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:772
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:884
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f5d48872b0f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:893
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:797
jl_parse_eval_all at /buildworker/worker/package_linux64/build/src/ast.c:873
jl_load at /buildworker/worker/package_linux64/build/src/toplevel.c:859
include at ./boot.jl:325 [inlined]
include_relative at ./loading.jl:1042
include at ./Base.jl:31
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2226
exec_options at ./client.jl:295
_start at ./client.jl:464
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2226
jl_apply at /buildworker/worker/package_linux64/build/ui/../src/julia.h:1594 [inlined]
true_main at /buildworker/worker/package_linux64/build/ui/repl.c:96
main at /buildworker/worker/package_linux64/build/ui/repl.c:217
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
_start at /home/adrian/Downloads/julia-8649af9abe/bin/julia (unknown line)
Allocations: 15082729 (Pool: 15079560; Big: 3169); GC: 33
[1]    19165 illegal hardware instruction (core dumped)  ~/Downloads/julia-8649af9abe/bin/julia bug.jl

Version info:

julia> versioninfo()
Julia Version 1.2.0-DEV.557
Commit 8649af9abe (2019-03-26 17:56 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviortypes and dispatchTypes, subtyping and method dispatch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions