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 #30346

Closed
saschatimme opened this issue Dec 11, 2018 · 4 comments · Fixed by #30360
Closed

Unreachable reached #30346

saschatimme opened this issue Dec 11, 2018 · 4 comments · Fixed by #30360
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch

Comments

@saschatimme
Copy link
Contributor

I hit a bug very similar to #30122. Unfortunately I was not able to reduce this to a self-contained example. This is on the release-1.1 branch.

              _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0-DEV.839 (2018-12-07)
 _/ |\__'_|_|_|\__'_|  |  Commit b55b85cd99 (3 days old master)
|__/                   |

julia> versioninfo()
Julia Version 1.1.0-DEV.839
Commit b55b85cd99 (2018-12-07 17:20 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.0.0)
  CPU: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4

julia> using DynamicPolynomials
[ Info: Precompiling DynamicPolynomials [7c1d4256-1411-5781-91ec-d7bc3513ac07]

julia> @polyvar x[1:2]
Unreachable reached at 0x12a28a3ca

signal (4): Illegal instruction: 4
in expression starting at no file:0
setindex! at ./array.jl:764
collect_to_with_first! at ./array.jl:626
collect at ./array.jl:608
map at ./abstractarray.jl:2044 [inlined]
polyarrayvar at /Users/sascha/.julia/packages/DynamicPolynomials/3rBvr/src/var.jl:6
unknown function (ip: 0x12a28a37d)
jl_fptr_trampoline at /Users/sascha/coding/julia/src/gf.c:1854
do_call at /Users/sascha/coding/julia/src/interpreter.c:323
eval_stmt_value at /Users/sascha/coding/julia/src/interpreter.c:362 [inlined]
eval_body at /Users/sascha/coding/julia/src/interpreter.c:759
jl_interpret_toplevel_thunk_callback at /Users/sascha/coding/julia/src/interpreter.c:885
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x117da000f)
unknown function (ip: 0x1)
jl_interpret_toplevel_thunk at /Users/sascha/coding/julia/src/interpreter.c:894
jl_toplevel_eval_flex at /Users/sascha/coding/julia/src/toplevel.c:764
jl_toplevel_eval at /Users/sascha/coding/julia/src/toplevel.c:773 [inlined]
jl_toplevel_eval_in at /Users/sascha/coding/julia/src/toplevel.c:793
eval at ./boot.jl:328
eval_user_input at /Users/sascha/coding/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /Users/sascha/coding/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#26 at ./task.jl:259
jl_apply at /Users/sascha/coding/julia/src/./julia.h:1571 [inlined]
start_task at /Users/sascha/coding/julia/src/task.c:572
Allocations: 12189244 (Pool: 12186847; Big: 2397); GC: 26
Illegal instruction: 4
@maleadt
Copy link
Member

maleadt commented Dec 11, 2018

Can reproduce on release-1.1, assertion that is hit: julia: /home/tbesard/Julia/julia-dev/src/gf.c:1200: int check_ambiguous_visitor(jl_typemap_entry_t *, struct typemap_intersection_env *): Assertion `!jl_subtype((jl_value_t*)sig, (jl_value_t*)type)' failed.
EDIT: also on master, so not resolved (JuliaAlgebra/DynamicPolynomials.jl#38 (comment))

@maleadt
Copy link
Member

maleadt commented Dec 11, 2018

Reduced:

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0-DEV.854 (2018-12-11)
 _/ |\__'_|_|_|\__'_|  |  Commit 0d620001c2* (0 days old master)
|__/                   |

julia> module Foo
       abstract type A end
       abstract type B end
       Base.convert(::Type{T}, ::A) where T<:B = nothing
       Base.convert(::Type{<:Union{Number, T}}, ::A) where T = nothing
       end
julia: /home/tbesard/Julia/julia-dev/src/gf.c:1200: int check_ambiguous_visitor(jl_typemap_entry_t *, struct typemap_intersection_env *): Assertion `!jl_subtype((jl_value_t*)sig, (jl_value_t*)type)' failed.

signal (6): Aborted
in expression starting at no file:5
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f5622411a89)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
check_ambiguous_visitor at /home/tbesard/Julia/julia-dev/src/gf.c:1200
jl_typemap_intersection_node_visitor at /home/tbesard/Julia/julia-dev/src/typemap.c:0
jl_typemap_intersection_visitor at /home/tbesard/Julia/julia-dev/src/typemap.c:553
jl_typemap_intersection_visitor at /home/tbesard/Julia/julia-dev/src/typemap.c:544
check_ambiguous_matches at /home/tbesard/Julia/julia-dev/src/gf.c:1287
jl_method_table_insert at /home/tbesard/Julia/julia-dev/src/gf.c:1565
jl_method_def at /home/tbesard/Julia/julia-dev/src/method.c:800
eval_methoddef at /home/tbesard/Julia/julia-dev/src/interpreter.c:309
eval_body at /home/tbesard/Julia/julia-dev/src/interpreter.c:732
jl_interpret_toplevel_thunk_callback at /home/tbesard/Julia/julia-dev/src/interpreter.c:885
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f5615caae4f)
unknown function (ip: 0xa)
jl_interpret_toplevel_thunk at /home/tbesard/Julia/julia-dev/src/interpreter.c:894
jl_toplevel_eval_flex at /home/tbesard/Julia/julia-dev/src/toplevel.c:764
jl_eval_module_expr at /home/tbesard/Julia/julia-dev/src/toplevel.c:179
jl_toplevel_eval_flex at /home/tbesard/Julia/julia-dev/src/toplevel.c:614
jl_toplevel_eval at /home/tbesard/Julia/julia-dev/src/toplevel.c:773 [inlined]
jl_toplevel_eval_in at /home/tbesard/Julia/julia-dev/src/toplevel.c:793
eval at ./boot.jl:328
jl_apply_generic at /home/tbesard/Julia/julia-dev/src/gf.c:2209
eval_user_input at /home/tbesard/Julia/julia-dev/build/release/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /home/tbesard/Julia/julia-dev/build/release/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#26 at ./task.jl:259
jl_fptr_trampoline at /home/tbesard/Julia/julia-dev/src/gf.c:1854
jl_apply_generic at /home/tbesard/Julia/julia-dev/src/gf.c:2209
jl_apply at /home/tbesard/Julia/julia-dev/src/julia.h:1571 [inlined]
start_task at /home/tbesard/Julia/julia-dev/src/task.c:572
unknown function (ip: 0xffffffffffffffff)
Allocations: 11775953 (Pool: 11773673; Big: 2280); GC: 25
zsh: abort      ./julia

@maleadt maleadt added bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch labels Dec 11, 2018
@JeffBezanson
Copy link
Member

The assertion failure is not necessarily related.

@JeffBezanson
Copy link
Member

Ah, it looks like in this case it is, since the compiler and runtime seem to disagree on whether there is an ambiguity error.

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

Successfully merging a pull request may close this issue.

3 participants