-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
New type system: stackoverflow when defining method #20103
Comments
Remove try-end block in runtests.jl after JuliaLang/julia#20103 is fixed.
I may have run into something similar to this, although this is a much more self-contained report than I was able to generate. Specifically, I encountered a edit: I could only see that it was a stack overflow if precompilation was off, otherwise precompilation would fail with little explanation. |
It took me some digging too... In my case, the work around was to wrap the function definition in a |
It's actual a subtyping assertion failure, the StackOverflowError is just accidentally catching the memory corruption and thinking it can continue on a non-debug build.
|
I came across this case that looks like it might have the same root cause:
|
I wonder whether I get the same bug with CategoricalArrays. Loading the package with Julia master gives a stack overflow unless I remove this |
Might this be related? julia> typeintersect(Type{NTuple{N,E}} where E where N, Type{NTuple{N,E} where N} where E)
ERROR: StackOverflowError:
Stacktrace:
[1] typeintersect(::Any, ::Any) at ./reflection.jl:241 |
I think I got something similar... The range of errors I can produce with this example is quite interesting: # Build types
ints = (Int, Int32, UInt, UInt32)
typealias Ints Union{ints...}
vecs = []
for i = 2:4, t in ints
push!(vecs, NTuple{i, t})
end
typealias Vecs Union{vecs...}
# Lets produce some errors:
# this one just froze one time, succeeded other times:
T = Type{Tuple{V, I}} where V <: Vecs where I <: Ints
# this one gave me a ReadOnlyMemoryError()
typeintersect(T, T)
test{V <: Vecs, I <: Ints}(a::Type{Tuple{V, I}}) = I
# Freezes or gives a stackoverflow:
test{V <: Vecs, I <: Ints}(a::Type{Tuple{V, I}}) = I Update: Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x64f6e046 -- subtype_unionall at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:461
while loading no file, in expression starting on line 0
subtype_unionall at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:461
subtype at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:703
subtype_unionall at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:465
subtype at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:700
subtype_unionall at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:465
subtype at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:700
exists_subtype at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:808 [inlined]
forall_exists_subtype at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:836
jl_subtype_env at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:887 [inlined]
jl_subtype at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:904 [inlined]
jl_types_equal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\subtype.c:911
jl_typemap_lookup_by_type_ at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\typemap.c:653 [inlined]
jl_typemap_assoc_by_type at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\typemap.c:730
jl_typemap_insert at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\typemap.c:988
jl_method_table_insert at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1348
jl_method_def at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\method.c:684
eval at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:276
eval_body at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:600
jl_interpret_toplevel_thunk at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:664
jl_toplevel_eval_flex at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:592 [inlined]
jl_toplevel_eval at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:600
jl_toplevel_eval_in at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\builtins.c:614
eval at .\boot.jl:236
unknown function (ip: 0000000061C6F085)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:248 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:2217
eval_user_input at .\REPL.jl:66
unknown function (ip: 00000000162C613A)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:248 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:2217
macro expansion at .\REPL.jl:97 [inlined]
#1 at .\event.jl:73
unknown function (ip: 00000000162C3833)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:248 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:2217
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1411 [inlined]
start_task at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\task.c:261
Allocations: 3656213 (Pool: 3654837; Big: 1376); GC: 4 Second run after restarting Julia |
bump |
Seems like my example is the only one still segfaulting. Should I open a new issue and close this? |
Has the same assertion failure as #21191. |
Looks like this is mostly fixed now (0.6.0-pre.beta.91), the only example still crashing is #20103 (comment), which looks closely related to #21191 indeed (but I only checked the code pieces given here, not the links to packages). And julia> typeintersect(Type{NTuple{N,E}} where E where N, Type{NTuple{N,E} where N} where E)
Type{Tuple{}} where E doesn't crash, but I think it should give I'll submit tests for these, and then I think we can close this. |
My example still segfaults on 8934aab :( |
confirmed, 8208f86 fixes it :) |
I'm pretty sure this only showed up after the #18457 merge (maybe add to list in #19998):
The text was updated successfully, but these errors were encountered: