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

(One more) Crash in subtype_unionall() #26065

Open
ulysses4ever opened this Issue Feb 15, 2018 · 0 comments

Comments

2 participants
@ulysses4ever

ulysses4ever commented Feb 15, 2018

Disclamer: This very well may be duplicate for #22123 (or rather #21191 #21153, @martinholters should know better, I guess).

I have this (crazy, unrealistic, computer-generated) type:

Ref{Tuple{T,Ref{Union{Ref{Tuple{Ref{Union{Ref{Ref{Tuple{Ref{Tuple{Union{Tuple{Ref{Ref{T}},T}, T},T}},T}}}, T}},T}}, Ref{T}, T}}}} where T

Julia (recent master) dies when I try to check reflexivity for it:

t = Ref{Tuple{T,Ref{Union{Ref{Tuple{Ref{Union{Ref{Ref{Tuple{Ref{Tuple{Union{Tuple{Ref{Ref{T}},T}, T},T}},T}}}, T}},T}}, Ref{T}, T}}}} where T

s = Ref{Tuple{T,Ref{Union{Ref{Tuple{Ref{Union{Ref{Ref{Tuple{Ref{Tuple{Union{Tuple{Ref{Ref{T}},T}, T},T}},T}}}, T}},T}}, Ref{T}, T}}}} where T

t <: s

(I use different bindings, s and t, otherwise it will trivially says true.)

I compared the output to the one of #22123, here is the diff. They are very similar, but one call to subtype_unionall. I was about to forget this, but as a last resort fired up julia-debug. And there I got notably different output. So i decided to file a bug. The output from julia-debugis:

julia-debug: /home/artem/julia-dev/src/subtype.c:114: statestack_get: Assertion `i >= 0 && i < sizeof(st->stack) * 8' failed.

signal (6): Aborted
in expression starting at /home/artem/julia-work/exp/crash-rj1.jl:7
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: 0x7fc23523dbd6)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
statestack_get at /home/artem/julia-dev/src/subtype.c:114
pick_union_element at /home/artem/julia-dev/src/subtype.c:388
subtype at /home/artem/julia-dev/src/subtype.c:846
subtype_ufirst at /home/artem/julia-dev/src/subtype.c:416
var_lt at /home/artem/julia-dev/src/subtype.c:454
subtype at /home/artem/julia-dev/src/subtype.c:883
subtype_tuple at /home/artem/julia-dev/src/subtype.c:796
subtype at /home/artem/julia-dev/src/subtype.c:926
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
subtype_tuple at /home/artem/julia-dev/src/subtype.c:796
subtype at /home/artem/julia-dev/src/subtype.c:926
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
subtype_tuple at /home/artem/julia-dev/src/subtype.c:796
subtype at /home/artem/julia-dev/src/subtype.c:926
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
subtype_tuple at /home/artem/julia-dev/src/subtype.c:796
subtype at /home/artem/julia-dev/src/subtype.c:926
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
subtype_unionall at /home/artem/julia-dev/src/subtype.c:593
subtype at /home/artem/julia-dev/src/subtype.c:896
subtype_unionall at /home/artem/julia-dev/src/subtype.c:624
subtype at /home/artem/julia-dev/src/subtype.c:893
exists_subtype at /home/artem/julia-dev/src/subtype.c:1009
forall_exists_subtype at /home/artem/julia-dev/src/subtype.c:1037
jl_subtype_env at /home/artem/julia-dev/src/subtype.c:1091
jl_subtype at /home/artem/julia-dev/src/subtype.c:1109
jl_f_issubtype at /home/artem/julia-dev/src/builtins.c:416
jl_call_fptr_internal at /home/artem/julia-dev/src/julia_internal.h:383
jl_call_method_internal at /home/artem/julia-dev/src/julia_internal.h:402
jl_apply_generic at /home/artem/julia-dev/src/gf.c:2089
do_call at /home/artem/julia-dev/src/interpreter.c:323
eval_value at /home/artem/julia-dev/src/interpreter.c:395
eval_body at /home/artem/julia-dev/src/interpreter.c:509
jl_interpret_toplevel_thunk_callback at /home/artem/julia-dev/src/interpreter.c:720
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7fc2270e190f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /home/artem/julia-dev/src/interpreter.c:729
jl_toplevel_eval_flex at /home/artem/julia-dev/src/toplevel.c:806
jl_parse_eval_all at /home/artem/julia-dev/src/ast.c:839
jl_load at /home/artem/julia-dev/src/toplevel.c:844
jl_load_ at /home/artem/julia-dev/src/toplevel.c:851
include at ./boot.jl:296 [inlined]
include_relative at ./loading.jl:1012
jl_call_fptr_internal at /home/artem/julia-dev/src/julia_internal.h:383
jl_call_method_internal at /home/artem/julia-dev/src/julia_internal.h:402
jl_apply_generic at /home/artem/julia-dev/src/gf.c:2089
include at ./sysimg.jl:26
jl_call_fptr_internal at /home/artem/julia-dev/src/julia_internal.h:383
jl_call_method_internal at /home/artem/julia-dev/src/julia_internal.h:402
jl_apply_generic at /home/artem/julia-dev/src/gf.c:2089
exec_options at ./client.jl:332
_start at ./client.jl:447
jl_call_fptr_internal at /home/artem/julia-dev/src/julia_internal.h:383
jl_call_method_internal at /home/artem/julia-dev/src/julia_internal.h:402
jl_apply_generic at /home/artem/julia-dev/src/gf.c:2089
jl_apply at /home/artem/julia-dev/ui/../src/julia.h:1523
true_main at /home/artem/julia-dev/ui/repl.c:107
main at /home/artem/julia-dev/ui/repl.c:238
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at ./julia-debug (unknown line)
Allocations: 461264 (Pool: 460989; Big: 275); GC: 0
Aborted (core dumped)

Versioninfo:

Julia Version 0.7.0-DEV.3716
Commit 842ff17 (2018-02-05 03:16 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment