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

Assertion failure in jl_gf_invoke_lookup (detect_unbound_args-related) #24460

Closed
timholy opened this issue Nov 3, 2017 · 2 comments · Fixed by #25495
Closed

Assertion failure in jl_gf_invoke_lookup (detect_unbound_args-related) #24460

timholy opened this issue Nov 3, 2017 · 2 comments · Fixed by #25495
Labels
priority This should be addressed urgently

Comments

@timholy
Copy link
Member

timholy commented Nov 3, 2017

On the teh/extensible_broadcast I'm getting a curious failure in test/ambiguous (this from a debug build in which I've inserted @show tuple_sig right before this line):

shell> cd test
/home/tim/src/julia-branch/test

julia> using Test

julia> include("ambiguous.jl")
Skipping Base.Distributed.cluster_manager
Skipping Base.Filesystem.JL_O_RANDOM
Skipping Base.Filesystem.JL_O_SEQUENTIAL
Skipping Base.Filesystem.JL_O_SHORT_LIVED
Skipping Base.Filesystem.JL_O_TEMPORARY
Skipping Base.dSFMT.win32_SystemFunction036!
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{typeof(Core.Inference.cat),Any}
tuple_sig = Tuple{typeof(Core.Inference.hcat)}
tuple_sig = Tuple{typeof(Core.Inference.hcat)}
tuple_sig = Tuple{typeof(Core.Inference.hcat)}
tuple_sig = Tuple{typeof(Core.Inference.hcat)}
tuple_sig = Tuple{typeof(Core.Inference.hvcat),Tuple{Vararg{Int64,N} where N}}
tuple_sig = Tuple{typeof(Core.Inference.hvcat),Tuple{Vararg{Int64,N} where N}}
tuple_sig = Tuple{typeof(Core.Inference.vcat)}
tuple_sig = Tuple{typeof(Core.Inference.vcat)}
tuple_sig = Tuple{typeof(Core.Inference.vcat)}
tuple_sig = Tuple{typeof(Core.Inference.vcat)}
tuple_sig = Tuple{typeof(Core.Inference.vcat)}
tuple_sig = Tuple{typeof(Core.Inference.vcat)}
tuple_sig = Tuple{typeof(Core.Inference.vect)}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{Dict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{Type{WeakKeyDict}}
tuple_sig = Tuple{typeof(cat),Any}
tuple_sig = Tuple{typeof(cat),Any}
tuple_sig = Tuple{typeof(hcat)}
tuple_sig = Tuple{typeof(hcat)}
tuple_sig = Tuple{typeof(hcat)}
tuple_sig = Tuple{typeof(hcat)}
tuple_sig = Tuple{typeof(hcat)}
tuple_sig = Tuple{typeof(hcat)}
tuple_sig = Tuple{typeof(hcat)}
tuple_sig = Tuple{typeof(hvcat),Tuple{Vararg{Int64,N} where N}}
tuple_sig = Tuple{typeof(hvcat),Tuple{Vararg{Int64,N} where N}}
tuple_sig = Tuple{typeof(hvcat),Tuple{Vararg{Int64,N} where N}}
tuple_sig = Tuple{typeof(Base.same_names)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(vcat)}
tuple_sig = Tuple{typeof(Base.vect)}
tuple_sig = Tuple{typeof(withenv),Function}
tuple_sig = Tuple{typeof(Base.Broadcast.broadcast_similar),Any,Base.Broadcast.DefaultArrayStyle{N},Type{Bool},Tuple{Vararg{AbstractUnitRange,N}}} where N
julia: /home/tim/src/julia-branch/src/julia.h:701: jl_svecref: Assertion `jl_typeis(t,jl_simplevector_type)' failed.

Thread 1 "julia" received signal SIGABRT, Aborted.
0x00007ffff6b21428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6b21428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff6b2302a in __GI_abort () at abort.c:89
#2  0x00007ffff6b19bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x7ffff7790b48 "jl_typeis(t,jl_simplevector_type)", 
    file=file@entry=0x7ffff7790b20 "/home/tim/src/julia-branch/src/julia.h", line=line@entry=701, 
    function=function@entry=0x7ffff77914e0 <__PRETTY_FUNCTION__.27486> "jl_svecref") at assert.c:92
#3  0x00007ffff6b19c82 in __GI___assert_fail (assertion=0x7ffff7790b48 "jl_typeis(t,jl_simplevector_type)", 
    file=0x7ffff7790b20 "/home/tim/src/julia-branch/src/julia.h", line=701, function=0x7ffff77914e0 <__PRETTY_FUNCTION__.27486> "jl_svecref") at assert.c:101
#4  0x00007ffff75170ec in jl_svecref (t=0x7fffebb87a90, i=0) at /home/tim/src/julia-branch/src/julia.h:701
#5  0x00007ffff751edeb in jl_gf_invoke_lookup (types=0x7fffeb66f8f0, world=18446744073709551615) at /home/tim/src/julia-branch/src/gf.c:2009
#6  0x00007fffbb5ba410 in japi1_#detect_unbound_args#28_62734 (imported=0 '\000', recursive=1 '\001', mods...=<optimized out>)
    at /home/tim/src/julia-branch/usr/share/julia/site/v0.7/Test/src/Test.jl:1303
#7  0x00007ffff75181e9 in jl_call_fptr_internal (fptr=0x7fffffffbc30, meth=0x7fffe9fd1990, args=0x7fffffffbcf0, nargs=5)
    at /home/tim/src/julia-branch/src/julia_internal.h:366
#8  0x00007ffff75182fa in jl_call_method_internal (meth=0x7fffe9fd1990, args=0x7fffffffbcf0, nargs=5) at /home/tim/src/julia-branch/src/julia_internal.h:385
#9  0x00007ffff751ed8b in jl_apply_generic (args=0x7fffffffbcf0, nargs=5) at /home/tim/src/julia-branch/src/gf.c:2003
#10 0x00007ffff752b184 in jl_apply (args=0x7fffffffbcf0, nargs=5) at /home/tim/src/julia-branch/src/julia.h:1471
#11 0x00007ffff752e14a in jl_f__apply (F=0x0, args=0x7fffffffbe88, nargs=3) at /home/tim/src/julia-branch/src/builtins.c:556
#12 0x00007fffbb5b9b01 in japi1_#detect_unbound_args_62733 (mods...=0x7fffee58bec0 <jl_system_image_data+2007168>)
#13 0x00007ffff75181e9 in jl_call_fptr_internal (fptr=0x7fffffffbf50, meth=0x7fffea160810, args=0x7fffffffc070, nargs=4)
    at /home/tim/src/julia-branch/src/julia_internal.h:366
#14 0x00007ffff75182fa in jl_call_method_internal (meth=0x7fffea160810, args=0x7fffffffc070, nargs=4) at /home/tim/src/julia-branch/src/julia_internal.h:385
#15 0x00007ffff751ed8b in jl_apply_generic (args=0x7fffffffc070, nargs=4) at /home/tim/src/julia-branch/src/gf.c:2003
#16 0x00007fffbb5ba6ba in japi1_#detect_unbound_args#28_62734 (imported=0 '\000', recursive=1 '\001', mods...=<optimized out>)
    at /home/tim/src/julia-branch/usr/share/julia/site/v0.7/Test/src/Test.jl:1292
#17 0x00007ffff75181e9 in jl_call_fptr_internal (fptr=0x7fffffffc140, meth=0x7fffe9fd1990, args=0x7fffffffc200, nargs=5)
    at /home/tim/src/julia-branch/src/julia_internal.h:366
#18 0x00007ffff75182fa in jl_call_method_internal (meth=0x7fffe9fd1990, args=0x7fffffffc200, nargs=5) at /home/tim/src/julia-branch/src/julia_internal.h:385
#19 0x00007ffff751ed8b in jl_apply_generic (args=0x7fffffffc200, nargs=5) at /home/tim/src/julia-branch/src/gf.c:2003
#20 0x00007ffff752b184 in jl_apply (args=0x7fffffffc200, nargs=5) at /home/tim/src/julia-branch/src/julia.h:1471
#21 0x00007ffff752e14a in jl_f__apply (F=0x0, args=0x7fffffffc398, nargs=3) at /home/tim/src/julia-branch/src/builtins.c:556
#22 0x00007fffbb5b9b01 in japi1_#detect_unbound_args_62733 (mods...=0x7fffee3a4a30 <jl_system_image_data+11248>)
#23 0x00007ffff75181e9 in jl_call_fptr_internal (fptr=0x7fffffffc460, meth=0x7fffea160810, args=0x7fffffffc770, nargs=4)
    at /home/tim/src/julia-branch/src/julia_internal.h:366
#24 0x00007ffff75182fa in jl_call_method_internal (meth=0x7fffea160810, args=0x7fffffffc770, nargs=4) at /home/tim/src/julia-branch/src/julia_internal.h:385
#25 0x00007ffff7518485 in jl_invoke (meth=0x7fffea160810, args=0x7fffffffc770, nargs=4) at /home/tim/src/julia-branch/src/gf.c:41
#26 0x00007fffbb5b574f in macro expansion () at /home/tim/src/julia-branch/test/ambiguous.jl:268
#27 macro expansion () at /home/tim/src/julia-branch/usr/share/julia/site/v0.7/Test/src/Test.jl:950
#28 japi1_anonymous_62715 () at <missing>:65535
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) f 5
#5  0x00007ffff751edeb in jl_gf_invoke_lookup (types=0x7fffeb66f8f0, world=18446744073709551615) at /home/tim/src/julia-branch/src/gf.c:2009
2009        jl_methtable_t *mt = ((jl_datatype_t*)jl_tparam0(types))->name->mt;
(gdb) call jl_(types)
Tuple{typeof(Base.Broadcast.broadcast_similar), Any, Base.Broadcast.DefaultArrayStyle{N}, Type{Bool}, Tuple{Vararg{Base.AbstractUnitRange{T} where T, N}}} where N
(gdb) call jl_(types)
Tuple{typeof(Base.Broadcast.broadcast_similar), Any, Base.Broadcast.DefaultArrayStyle{N}, Type{Bool}, Tuple{Vararg{Base.AbstractUnitRange{T} where T, N}}} where N
(gdb) call jl_(types.parameters)
String
(gdb) 

Memory corruption?

@timholy
Copy link
Member Author

timholy commented Nov 3, 2017

I should add that this failure seems to be deterministic, with the exception of the type reported by jl_(types.parameters) (on different runs I get at least String or Any).

@timholy
Copy link
Member Author

timholy commented Nov 19, 2017

This still happens on current master. It blocks the merger of #23939, and with impending feature freeze it risks sticking us with the old API.

This appears to be some form of memory corruption, and I worry that I lack the time to track it down myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority This should be addressed urgently
Projects
None yet
2 participants