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

collect-related segfault #31406

Closed
xitology opened this issue Mar 19, 2019 · 4 comments · Fixed by #31671
Closed

collect-related segfault #31406

xitology opened this issue Mar 19, 2019 · 4 comments · Fixed by #31671
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@xitology
Copy link
Contributor

I'm getting segfault with the following code:

julia> versioninfo()
Julia Version 1.2.0-DEV.491
Commit 8c0b550b61 (2019-03-17 17:35 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

julia> abstract type Shape end

julia> struct ValueOf <: Shape; ty::Type; end

julia> struct TupleOf <: Shape; cols::Vector{Shape}; end

julia> TupleOf(cols::Union{Shape,Type}...) = TupleOf(collect(Shape, cols))
TupleOf

julia> TupleOf(ValueOf(Int), Float64)
Unreachable reached at 0x7f89b108fb6a

signal (4): Illegal instruction
in expression starting at REPL[6]:1
setindex! at ./array.jl:766
copyto! at ./abstractarray.jl:680 [inlined]
_collect at ./array.jl:505 [inlined]
collect at ./array.jl:503 [inlined]
Type at ./REPL[5]:1
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1895
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2250
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: 0x7f89c137900f)
unknown function (ip: (nil))
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_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:746
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:826
eval at ./boot.jl:327
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2250
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:118 [inlined]
#26 at ./task.jl:261
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2250
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1594 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:572
unknown function (ip: 0xffffffffffffffff)
Allocations: 6029628 (Pool: 6028094; Big: 1534); GC: 12
Illegal instruction (core dumped)

It seems to work fine with --inline=no.

@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Mar 19, 2019
@Keno Keno self-assigned this Mar 24, 2019
@Keno
Copy link
Member

Keno commented Mar 24, 2019

Looks like jl_compilation_sig invalidly changes
Tuple{typeof(Base.setindex!), Array{Main.Shape, 1}, Union{Main.Shape, Type}, Int64} to
Tuple{typeof(Base.setindex!), Array{Main.Shape, 1}, Type{T} where T, Int64}

@Keno
Copy link
Member

Keno commented Mar 24, 2019

The problematic code path was introduced in #30458 so I'll leave this to @vtjnash

@Keno Keno assigned vtjnash and unassigned Keno Mar 24, 2019
@JeffBezanson JeffBezanson added this to the 1.2 milestone Mar 27, 2019
@diegozea
Copy link
Contributor

diegozea commented Apr 9, 2019

Could this segfault be related? It is not related to collect (it is related to a constructor) but It also gets solved when Julia runs with --inline=no.

@JeffBezanson
Copy link
Member

I would file an issue for that.

vtjnash added a commit that referenced this issue Apr 10, 2019
it should only widen a signature, not narrow it, but was using intersect instead of subtype

fix #31406
JeffBezanson pushed a commit that referenced this issue Apr 11, 2019
it should only widen a signature, not narrow it, but was using intersect instead of subtype

fix #31406
KristofferC pushed a commit that referenced this issue Apr 15, 2019
it should only widen a signature, not narrow it, but was using intersect instead of subtype

fix #31406

(cherry picked from commit b4e95cb)
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants