You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Julia does not seem to be able to handle a Union of strictly more than 3265 types.
First, it segfaults when trying to print it:
julia> n = 3266
3266
julia> for i in 1:n
eval(Meta.parse("struct T$i end")) # Creating the types
end
julia> collection = (eval(Meta.parse("T$i")) for i in 1:n)
Base.Generator{UnitRange{Int64},getfield(Main, Symbol("##3#4"))}(getfield(Main, Symbol("##3#4"))(), 1:3266)
julia> Union{collection...}
signal (11): Segmentation fault
in expression starting at no file:0
unknown function (ip: 0x7f8626f4b319)
memset at /usr/include/x86_64-linux-gnu/bits/string3.h:90 [inlined]
restore_env at /home/liozou/julia/src/subtype.c:172 [inlined]
exists_subtype at /home/liozou/julia/src/subtype.c:1013 [inlined]
forall_exists_subtype at /home/liozou/julia/src/subtype.c:1039
jl_subtype_env at /home/liozou/julia/src/subtype.c:1094
jl_types_equal at /home/liozou/julia/src/subtype.c:1119
typekey_eq at /home/liozou/julia/src/jltypes.c:664 [inlined]
lookup_type_idx at /home/liozou/julia/src/jltypes.c:720
lookup_type at /home/liozou/julia/src/jltypes.c:731 [inlined]
inst_datatype_inner at /home/liozou/julia/src/jltypes.c:1106
inst_datatype_env at /home/liozou/julia/src/jltypes.c:1309 [inlined]
inst_datatype_env at /home/liozou/julia/src/jltypes.c:1313
inst_datatype at /home/liozou/julia/src/jltypes.c:1319 [inlined]
inst_type_w_ at /home/liozou/julia/src/jltypes.c:1510
jl_instantiate_unionall at /home/liozou/julia/src/jltypes.c:940
arg_type_tuple at /home/liozou/julia/src/gf.c:1639
jl_lookup_generic_ at /home/liozou/julia/src/gf.c:2144 [inlined]
jl_apply_generic at /home/liozou/julia/src/gf.c:2175
inner at ./essentials.jl:662
jl_fptr_trampoline at /home/liozou/julia/src/gf.c:1849
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
jl_apply at /home/liozou/julia/src/julia.h:1541 [inlined]
jl_f__apply at /home/liozou/julia/src/builtins.c:554
jl_f__apply_latest at /home/liozou/julia/src/builtins.c:592
#invokelatest#3 at ./essentials.jl:663 [inlined]
invokelatest at ./essentials.jl:662 [inlined]
print_response at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:151
jfptr_print_response_17986 at /home/liozou/julia/usr/lib/julia/sys.so (unknown line)
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
print_response at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:137
jfptr_print_response_17982 at /home/liozou/julia/usr/lib/julia/sys.so (unknown line)
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
do_respond at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:705
unknown function (ip: 0x7f8614343982)
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
do_call at /home/liozou/julia/src/interpreter.c:324
eval_value at /home/liozou/julia/src/interpreter.c:416
eval_body at /home/liozou/julia/src/interpreter.c:538
jl_interpret_toplevel_thunk_callback at /home/liozou/julia/src/interpreter.c:798
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f86175bdecf)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /home/liozou/julia/src/interpreter.c:807
jl_toplevel_eval_flex at /home/liozou/julia/src/toplevel.c:856
jl_toplevel_eval_in at /home/liozou/julia/src/builtins.c:624
eval at ./boot.jl:317 [inlined]
eval at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/LineEdit.jl:3
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
run_interface at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/LineEdit.jl:2213
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
run_frontend at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:1025
run_repl at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:187
jl_fptr_trampoline at /home/liozou/julia/src/gf.c:1849
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
#680 at ./client.jl:416
inner at ./essentials.jl:662
jl_fptr_trampoline at /home/liozou/julia/src/gf.c:1849
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
jl_apply at /home/liozou/julia/src/julia.h:1541 [inlined]
jl_f__apply at /home/liozou/julia/src/builtins.c:554
jl_f__apply_latest at /home/liozou/julia/src/builtins.c:592
#invokelatest#3 at ./essentials.jl:663 [inlined]
invokelatest at ./essentials.jl:662 [inlined]
run_main_repl at ./client.jl:400
exec_options at ./client.jl:338
_start at ./client.jl:457
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
unknown function (ip: 0x401c90)
unknown function (ip: 0x40145c)
__libc_start_main at /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
unknown function (ip: 0x401508)
Allocations: 2448638 (Pool: 2447464; Big: 1174); GC: 5
Segmentation fault (core dumped)
Note that the error does not come from splatting nor from the creation of the Union itself, since adding a ; at the end of the line removes the segfault.
Second issue, it segfaults on dispatch:
julia> n = 3266
3266
julia> for i in 1:n
eval(Meta.parse("struct T$i end"))
end
julia> collection = (eval(Meta.parse("T$i")) for i in 1:n)
Base.Generator{UnitRange{Int64},getfield(Main, Symbol("##3#4"))}(getfield(Main, Symbol("##3#4"))(), 1:3265)
julia> T = Union{collection...}; # no segfault here while not printing T
julia> function foo(::T) end
foo (generic function with 1 method)
julia> foo(42)
signal (11): Segmentation fault
in expression starting at no file:0
unknown function (ip: 0x7f8a13cbc319)
memset at /usr/include/x86_64-linux-gnu/bits/string3.h:90 [inlined]
restore_env at /home/liozou/julia/src/subtype.c:172 [inlined]
exists_subtype at /home/liozou/julia/src/subtype.c:1013 [inlined]
forall_exists_subtype at /home/liozou/julia/src/subtype.c:1039
jl_subtype_env at /home/liozou/julia/src/subtype.c:1094
subtype_tuple at /home/liozou/julia/src/subtype.c:797 [inlined]
subtype at /home/liozou/julia/src/subtype.c:930
exists_subtype at /home/liozou/julia/src/subtype.c:1011 [inlined]
forall_exists_subtype at /home/liozou/julia/src/subtype.c:1039
jl_subtype_env at /home/liozou/julia/src/subtype.c:1094
jl_subtype_matching at /home/liozou/julia/src/subtype.c:2261
jl_typemap_assoc_by_type_ at /home/liozou/julia/src/typemap.c:596
jl_mt_assoc_by_type at /home/liozou/julia/src/gf.c:1102
jl_lookup_generic_ at /home/liozou/julia/src/gf.c:2146 [inlined]
jl_apply_generic at /home/liozou/julia/src/gf.c:2175
do_call at /home/liozou/julia/src/interpreter.c:324
eval_value at /home/liozou/julia/src/interpreter.c:416
eval_body at /home/liozou/julia/src/interpreter.c:559
jl_interpret_toplevel_thunk_callback at /home/liozou/julia/src/interpreter.c:798
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f8a041e9daf)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /home/liozou/julia/src/interpreter.c:807
jl_toplevel_eval_flex at /home/liozou/julia/src/toplevel.c:856
jl_toplevel_eval_in at /home/liozou/julia/src/builtins.c:624
eval at ./boot.jl:317 [inlined]
eval at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:5
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
eval_user_input at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:85
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
macro expansion at /home/liozou/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:116 [inlined]
#28 at ./event.jl:92
jl_fptr_trampoline at /home/liozou/julia/src/gf.c:1849
jl_apply_generic at /home/liozou/julia/src/gf.c:2178
jl_apply at /home/liozou/julia/src/julia.h:1541 [inlined]
start_task at /home/liozou/julia/src/task.c:268
unknown function (ip: 0xffffffffffffffff)
Allocations: 2287277 (Pool: 2286198; Big: 1079); GC: 5
Segmentation fault (core dumped)
Neither of the two segfaults happens on my computer for n = 3265, but I don't know if that matters.
The text was updated successfully, but these errors were encountered:
In the same context, taking n = 3265 in the last example does not segfault but throws an error on dispatch, as expected. However, even half an hour after the red ERROR: is printed, no actual error and backtrace show up, the REPL is dead frozen.
Julia does not seem to be able to handle a Union of strictly more than 3265 types.
First, it segfaults when trying to print it:
Note that the error does not come from splatting nor from the creation of the Union itself, since adding a
;
at the end of the line removes the segfault.Second issue, it segfaults on dispatch:
Neither of the two segfaults happens on my computer for n = 3265, but I don't know if that matters.
The text was updated successfully, but these errors were encountered: