Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreachable reached - Linux and Windows - Julia v1.0.1 and 0.7.0 #29955

Closed
mohamed82008 opened this issue Nov 8, 2018 · 6 comments
Closed

Unreachable reached - Linux and Windows - Julia v1.0.1 and 0.7.0 #29955

mohamed82008 opened this issue Nov 8, 2018 · 6 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch

Comments

@mohamed82008
Copy link
Contributor

Hi,

The following code seems to break multiple versions of Julia. I tried it on Linux and Windows, v0.7.0 and v1.0.1. It worked fine in Julia v0.6.4.

run(`git clone https://github.com/mohamed82008/TopOpt.jl TopOpt`)
cd(()->run(`git checkout segfault`), "TopOpt")
using Pkg
Pkg.activate("./TopOpt")
Pkg.instantiate()

include("TopOpt/test/segfault.jl")

Here is the Linux versioninfo():

Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)

Good luck!

@mohamed82008
Copy link
Contributor Author

Since the fix for this bug may take some time, I would appreciate any tip to work around it as it is currently a show stopper for using v1.0 in my work. Thank you.

@vchuravy
Copy link
Member

vchuravy commented Nov 8, 2018

For reference, with an assertion build.

Unreachable reached at 0x7f82c930ba0d

signal (4): Illegal instruction
in expression starting at /tmp/TopOpt/test/segfault.jl:7
Type at ./none:0
Type at ./none:0
unknown function (ip: 0x7f82c930b875)
jl_fptr_trampoline at /home/vchuravy/src/julia/src/gf.c:1854
jl_apply_generic at /home/vchuravy/src/julia/src/gf.c:2209
do_call at /home/vchuravy/src/julia/src/interpreter.c:323
eval_value at /home/vchuravy/src/julia/src/interpreter.c:411
eval_stmt_value at /home/vchuravy/src/julia/src/interpreter.c:362 [inlined]
eval_body at /home/vchuravy/src/julia/src/interpreter.c:753
jl_interpret_toplevel_thunk_callback at /home/vchuravy/src/julia/src/interpreter.c:883
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f82ab6b28ff)
unknown function (ip: 0x7)
jl_interpret_toplevel_thunk at /home/vchuravy/src/julia/src/interpreter.c:892
jl_toplevel_eval_flex at /home/vchuravy/src/julia/src/toplevel.c:764
jl_toplevel_eval_flex at /home/vchuravy/src/julia/src/toplevel.c:713
jl_parse_eval_all at /home/vchuravy/src/julia/src/ast.c:883
jl_load at /home/vchuravy/src/julia/src/toplevel.c:826
include at ./boot.jl:317 [inlined]
include_relative at ./loading.jl:1038
include at ./sysimg.jl:29
jl_apply_generic at /home/vchuravy/src/julia/src/gf.c:2209
include at ./client.jl:392
jl_fptr_trampoline at /home/vchuravy/src/julia/src/gf.c:1854
jl_apply_generic at /home/vchuravy/src/julia/src/gf.c:2209
do_call at /home/vchuravy/src/julia/src/interpreter.c:323
eval_value at /home/vchuravy/src/julia/src/interpreter.c:411
eval_stmt_value at /home/vchuravy/src/julia/src/interpreter.c:362 [inlined]
eval_body at /home/vchuravy/src/julia/src/interpreter.c:753
jl_interpret_toplevel_thunk_callback at /home/vchuravy/src/julia/src/interpreter.c:883
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f82cf00b4df)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /home/vchuravy/src/julia/src/interpreter.c:892
jl_toplevel_eval_flex at /home/vchuravy/src/julia/src/toplevel.c:764
jl_toplevel_eval_in at /home/vchuravy/src/julia/src/toplevel.c:793
eval at ./boot.jl:319
jl_apply_generic at /home/vchuravy/src/julia/src/gf.c:2209
eval_user_input at /home/vchuravy/builds/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /home/vchuravy/builds/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#26 at ./task.jl:259
jl_apply_generic at /home/vchuravy/src/julia/src/gf.c:2209
jl_apply at /home/vchuravy/src/julia/src/julia.h:1571 [inlined]
start_task at /home/vchuravy/src/julia/src/task.c:572
unknown function (ip: 0xffffffffffffffff)
Allocations: 52499071 (Pool: 52490987; Big: 8084); GC: 113
fish: “~/builds/julia/julia” terminated by signal SIGILL (Illegal instruction)
versioninfo()
Julia Version 1.1.0-DEV.595
Commit c2bda2c4de* (2018-11-01 17:49 UTC)

@JeffBezanson
Copy link
Member

I believe I've reduced it to this:

julia> struct MMAModel{T, TV<:AbstractVector{T}}
       end

julia> typeintersect(MMAModel, MMAModel{<:Any,TV} where TV>:Vector{Float64})
Union{}

@JeffBezanson JeffBezanson self-assigned this Nov 8, 2018
@JeffBezanson JeffBezanson added types and dispatch Types, subtyping and method dispatch bug Indicates an unexpected problem or unintended behavior labels Nov 8, 2018
@JeffBezanson
Copy link
Member

JeffBezanson commented Nov 9, 2018

Another one:

julia> struct A29955{T, TV<:AbstractVector{T}, TModel<:MMAModel{T,TV}}
       end

julia> typeintersect(Tuple{Type{A29955{Float64,Array{Float64,1},_1}} where _1,
                           Any},
                     Tuple{Type{A29955{T,TV,TM}},
                           TM} where {T,TV<:AbstractVector{T},TM<:MMAModel{T,TV}})
Union{}

@JeffBezanson
Copy link
Member

Turns out to be related to this interesting case:

julia> struct M29955{T, TV<:AbstractVector{T}}
       end

julia> M29955{T,Vector{Float64}} where T
ERROR: TypeError: in M29955, in TV, expected TV<:AbstractArray{T,1}, got Type{Array{Float64,1}}

That should probably be allowed.

@mohamed82008
Copy link
Contributor Author

Thanks!

KristofferC pushed a commit that referenced this issue Nov 19, 2018
@KristofferC KristofferC mentioned this issue Nov 19, 2018
61 tasks
KristofferC pushed a commit that referenced this issue Dec 12, 2018
KristofferC pushed a commit that referenced this issue Feb 11, 2019
KristofferC pushed a commit that referenced this issue Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

3 participants