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

Inference disabled by a world age issue (0.6.0-rc3) #22355

Closed
timholy opened this issue Jun 13, 2017 · 37 comments
Closed

Inference disabled by a world age issue (0.6.0-rc3) #22355

timholy opened this issue Jun 13, 2017 · 37 comments
Labels
compiler:inference Type inference

Comments

@timholy
Copy link
Member

timholy commented Jun 13, 2017

I have a quite complicated example (involving several official packages and a couple of private ones) that I haven't yet succeeded in simplifying, but I'm wondering whether this debug info is enough for a clue. Using this diff against 0.6.0-rc3:

$ git diff
diff --git a/base/inference.jl b/base/inference.jl
index b54a8de..b1598dd 100644
--- a/base/inference.jl
+++ b/base/inference.jl
@@ -2358,8 +2358,16 @@ end
 
 # work towards converging the valid age range for sv
 function update_valid_age!(min_valid::UInt, max_valid::UInt, sv::InferenceState)
+    minv, maxv = sv.min_valid, sv.max_valid
     sv.min_valid = max(sv.min_valid, min_valid)
     sv.max_valid = min(sv.max_valid, max_valid)
+    if !(!isdefined(sv.linfo, :def) || !sv.cached || sv.min_valid <= sv.params.world <= sv.max_valid)
+        println("def: ", isdefined(sv.linfo, :def))
+        println("cached: ", sv.cached)
+        println("bounds: ", sv.min_valid, ", ", sv.params.world, ", ", sv.max_valid)
+        println("original bounds: ", minv, ", ", maxv)
+        println("input bounds: ", min_valid, ", ", max_valid)
+    end
     @assert !isdefined(sv.linfo, :def) || !sv.cached || sv.min_valid <= sv.params.world <= sv.max_valid "invalid age range update"
     nothing
 end
@@ -2373,7 +2381,12 @@ function add_backedge(li::MethodInstance, caller::InferenceState)
         caller.stmt_edges[caller.currpc] = []
     end
     push!(caller.stmt_edges[caller.currpc], li)
-    update_valid_age!(li, caller)
+    try
+        update_valid_age!(li, caller)
+    catch ex
+        println("li: ", li)
+        rethrow(ex)
+    end
     nothing
 end

I got this backtrace (during precompilation):

def: true
cached: true
bounds: 0x000000000000553a, 0x0000000000005576, 0x0000000000000000
original bounds: 0x000000000000553a, 0xffffffffffffffff
input bounds: 0x0000000000000001, 0x0000000000000000
li: BufferedStreams.flushbuffer!(typeof(BufferedStreams.flushbuffer!), BufferedStreams.BufferedOutputStream{T} where T)
WARNING: An error occurred during inference. Type inference is now partially disabled.
Base.MethodError(f=typeof(Core.Inference.convert)(), args=(Base.AssertionError, "invalid age range update"), world=0x0000000000000ac2)
rec_backtrace at /home/tim/src/julia-0.6/src/stackwalk.c:84
record_backtrace at /home/tim/src/julia-0.6/src/task.c:245
jl_throw at /home/tim/src/julia-0.6/src/task.c:564
jl_method_error_bare at /home/tim/src/julia-0.6/src/gf.c:1476
jl_method_error at /home/tim/src/julia-0.6/src/gf.c:1494
jl_lookup_generic_ at /home/tim/src/julia-0.6/src/gf.c:1907 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1927
Type at ./coreimg.jl:14
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:343 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
update_valid_age! at ./inference.jl:2371
add_backedge at ./inference.jl:2385
typeinf_edge at ./inference.jl:2522
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
abstract_interpret at ./inference.jl:2069
unknown function (ip: 0x7fb3486cbfa6)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2738
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
abstract_interpret at ./inference.jl:2069
unknown function (ip: 0x7fb3486cbfa6)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2738
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
unknown function (ip: 0x7fb3486cb956)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2791
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
abstract_interpret at ./inference.jl:2069
unknown function (ip: 0x7fb3486cbfa6)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2738
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486f370a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_apply at ./inference.jl:1541
unknown function (ip: 0x7fb3486eefbe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1669
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
unknown function (ip: 0x7fb3486cb956)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2791
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486f370a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_apply at ./inference.jl:1541
unknown function (ip: 0x7fb3486eefbe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1669
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
unknown function (ip: 0x7fb3486cb956)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2791
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486f370a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_apply at ./inference.jl:1541
unknown function (ip: 0x7fb3486eefbe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1669
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
unknown function (ip: 0x7fb3486cb956)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2791
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
abstract_interpret at ./inference.jl:2069
unknown function (ip: 0x7fb3486cbfa6)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2738
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
abstract_interpret at ./inference.jl:2069
unknown function (ip: 0x7fb3486cbfa6)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2738
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
abstract_interpret at ./inference.jl:2069
unknown function (ip: 0x7fb3486cbfa6)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2738
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486f370a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_apply at ./inference.jl:1541
unknown function (ip: 0x7fb3486eefbe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1669
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
unknown function (ip: 0x7fb3486cb956)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2791
typeinf_loop at ./inference.jl:2637
typeinf_frame at ./inference.jl:2507
typeinf_edge at ./inference.jl:2530
unknown function (ip: 0x7fb3486d6c4a)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call_gf_by_type at ./inference.jl:1401
unknown function (ip: 0x7fb3486d4b66)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_call at ./inference.jl:1882
unknown function (ip: 0x7fb3486d09fe)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_eval_call at ./inference.jl:1912
abstract_eval at ./inference.jl:1935
unknown function (ip: 0x7fb3486cb956)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
abstract_interpret at ./inference.jl:2061
unknown function (ip: 0x7fb3486cbfa6)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_frame at ./inference.jl:2738
typeinf_loop at ./inference.jl:2654
typeinf_frame at ./inference.jl:2507
typeinf_code at ./inference.jl:2577
unknown function (ip: 0x7fb3486e734d)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
typeinf_ext at ./inference.jl:2616
unknown function (ip: 0x7fb3486c6722)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
jl_apply at /home/tim/src/julia-0.6/src/julia.h:1423 [inlined]
jl_apply_with_saved_exception_state at /home/tim/src/julia-0.6/src/rtutils.c:257
jl_type_infer at /home/tim/src/julia-0.6/src/gf.c:269
jl_compile_for_dispatch at /home/tim/src/julia-0.6/src/gf.c:1665
jl_compile_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:307 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:354 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
_atexit at ./initdefs.jl:85
unknown function (ip: 0x7fb34886cf48)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:1930
jl_apply at /home/tim/src/julia-0.6/src/julia.h:1423 [inlined]
jl_atexit_hook at /home/tim/src/julia-0.6/src/init.c:250
main at /home/tim/src/julia-0.6/ui/repl.c:265
__libc_start_main at /build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:291
unknown function (ip: 0x401668)

So the problem seems to be that the valid range of world ages for BufferedStreams.flushbuffer! is empty. (Either something is uninitialized, or a previous error is being encoded this way?)

If someone wants to debug this but needs access to my private repos, that can be arranged.

@timholy timholy added the compiler:inference Type inference label Jun 13, 2017
@tkelman
Copy link
Contributor

tkelman commented Jun 13, 2017

Is this fixed by #21677 or #21933? I've been reluctant to backport big changes to inference that came well after branching.

@timholy
Copy link
Member Author

timholy commented Jun 13, 2017

Images.jl doesn't compile on 0.7, and this case depends on Images. So I can't test this easily.

Though the error is possibly related:

julia> using ImageCore
julia: /home/tim/src/julia-1.0/src/gf.c:1321: jl_method_instance_add_backedge: Assertion `callee->min_world <= caller->min_world && callee->max_world >= caller->max_world' failed.

signal (6): Aborted
while loading no file, in expression starting on line 0
raise at /build/glibc-9tT8Do/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54
abort at /build/glibc-9tT8Do/glibc-2.23/stdlib/abort.c:89
__assert_fail_base at /build/glibc-9tT8Do/glibc-2.23/assert/assert.c:92
__assert_fail at /build/glibc-9tT8Do/glibc-2.23/assert/assert.c:101
jl_method_instance_add_backedge at /home/tim/src/julia-1.0/src/gf.c:1321
jl_insert_backedges at /home/tim/src/julia-1.0/src/dump.c:2233
_jl_restore_incremental at /home/tim/src/julia-1.0/src/dump.c:3286
jl_restore_incremental at /home/tim/src/julia-1.0/src/dump.c:3325
_include_from_serialized at ./loading.jl:157
_require_from_serialized at ./loading.jl:200
unknown function (ip: 0x7f8248bf2d3b)
jl_call_fptr_internal at /home/tim/src/julia-1.0/src/julia_internal.h:350
jl_call_method_internal at /home/tim/src/julia-1.0/src/julia_internal.h:369
jl_apply_generic at /home/tim/src/julia-1.0/src/gf.c:1925
_require_search_from_serialized at ./loading.jl:236
unknown function (ip: 0x7f8248bf366b)
jl_call_fptr_internal at /home/tim/src/julia-1.0/src/julia_internal.h:350
jl_call_method_internal at /home/tim/src/julia-1.0/src/julia_internal.h:369
jl_apply_generic at /home/tim/src/julia-1.0/src/gf.c:1925
_require at ./loading.jl:433
require at ./loading.jl:397
unknown function (ip: 0x7f8248bf5a19)
jl_call_fptr_internal at /home/tim/src/julia-1.0/src/julia_internal.h:350
jl_call_method_internal at /home/tim/src/julia-1.0/src/julia_internal.h:369
jl_apply_generic at /home/tim/src/julia-1.0/src/gf.c:1925
jl_apply at /home/tim/src/julia-1.0/src/julia.h:1440
eval_import_path_ at /home/tim/src/julia-1.0/src/toplevel.c:403
eval_import_path at /home/tim/src/julia-1.0/src/toplevel.c:431
jl_toplevel_eval_flex at /home/tim/src/julia-1.0/src/toplevel.c:498
jl_toplevel_eval at /home/tim/src/julia-1.0/src/toplevel.c:605
jl_toplevel_eval_in at /home/tim/src/julia-1.0/src/builtins.c:496
eval at ./boot.jl:236
unknown function (ip: 0x7f8248a257cd)
jl_call_fptr_internal at /home/tim/src/julia-1.0/src/julia_internal.h:350
jl_call_method_internal at /home/tim/src/julia-1.0/src/julia_internal.h:369
jl_apply_generic at /home/tim/src/julia-1.0/src/gf.c:1925
eval_user_input at ./REPL.jl:66
unknown function (ip: 0x7f8248ae23cd)
jl_call_fptr_internal at /home/tim/src/julia-1.0/src/julia_internal.h:350
jl_call_method_internal at /home/tim/src/julia-1.0/src/julia_internal.h:369
jl_apply_generic at /home/tim/src/julia-1.0/src/gf.c:1925
macro expansion at ./REPL.jl:97 [inlined]
#1 at ./event.jl:73
unknown function (ip: 0x7f823677261f)
jl_call_fptr_internal at /home/tim/src/julia-1.0/src/julia_internal.h:350
jl_call_method_internal at /home/tim/src/julia-1.0/src/julia_internal.h:369
jl_apply_generic at /home/tim/src/julia-1.0/src/gf.c:1925
jl_apply at /home/tim/src/julia-1.0/src/julia.h:1440
start_task at /home/tim/src/julia-1.0/src/task.c:267
unknown function (ip: 0xffffffffffffffff)
Allocations: 4160249 (Pool: 4158989; Big: 1260); GC: 7
Aborted (core dumped)

@yuyichao
Copy link
Contributor

yuyichao commented Jun 13, 2017

I've seen something similar for PyCall. I've just reduced it to

__precompile__()

module PyCall

const b = Ref(true)
function __init__()
    ntuple(3) do i
        b[] ? 1 : ""
    end
end

end

This does not directly trigger assertion for me but as shown by

yuyichao% JULIA_LOAD_PATH=${PWD} julia-debug -e 'using PyCall; @show typeof(PyCall.__init__).name.mt.cache.next'
typeof(PyCall.__init__).name.mt.cache.next = TypeMapEntry(nothing, Tuple{PyCall.#__init__}, nothing, svec(), 22215, 22214, MethodInstance for __init__(), true, true, false)

The serialized world age range is invalid (min > max), causing the precompiled __init__ to never be called....

@JeffBezanson
Copy link
Member

Dup of #22351 #22125 ?

@vtjnash
Copy link
Member

vtjnash commented Jun 13, 2017

Those age ranges aren't invalid, although #22340 may improve that case. If not, you can turn on the JL_DEBUG_METHOD_INVALIDATION flag in gf.c to learn the cause.

@yuyichao
Copy link
Contributor

The issue I post above is not solved by #22340

JL_DEBUG_METHOD_INVALIDATION gives

yuyichao% JULIA_LOAD_PATH=~/tmp/PyCall/src ./julia -e 'using PyCall; @show typeof(PyCall.__init__).name.mt.cache.next'
PyCall.#1(getfield(PyCall, Symbol("##1#2")), Int64)
 Base.next(typeof(Base.next), Base.Generator{Base.UnitRange{Int64}, getfield(PyCall, Symbol("##1#2"))}, Int64)
 Base.ntuple(typeof(Base.ntuple), getfield(PyCall, Symbol("##1#2")), Int64)
<<<
PyCall.__init__(typeof(PyCall.__init__))
<<<
typeof(PyCall.__init__).name.mt.cache.next = TypeMapEntry(nothing, Tuple{PyCall.#__init__}, nothing, svec(), 22215, 22214, MethodInstance for __init__(), true, true, false)

@vtjnash
Copy link
Member

vtjnash commented Jun 13, 2017

input bounds: 0x0000000000000001, 0x0000000000000000

The only place this invalid combination can be created is in dump.c, when it is trying to delete an invalid method. Apparently it's not doing a good enough job.

@yuyichao
Copy link
Contributor

yuyichao commented Jun 13, 2017

So I'm not sure how the serializer need to handle world ranges but the issue I'm seeing seems to be caused by lowerbound_dependent_world_set returning something that none of the callers can handle. All callers of it seem to expect an equal or lower number compare to the input but if no dependent function is found to have a equal or smaller def time the return value is actually a much newer world.

The following patch seems to solve the issue for the reduced PyCall case above

diff --git a/src/dump.c b/src/dump.c
index 8b39646fc8..1f0c1e887d 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -2180,7 +2180,7 @@ static size_t lowerbound_dependent_world_set(size_t world, arraylist_t *dependen
         if (depworld <= world)
             return depworld;
     }
-    return jl_main_module->primary_world;
+    return world;
 }

 void jl_method_instance_delete(jl_method_instance_t *mi);

Unclear if it is the right solution though.

@baggepinnen
Copy link
Contributor

baggepinnen commented Jun 19, 2017

I just ran into the same issue upon using Robotlib
The same issue does not appear if I first run

julia> using DataArrays
julia> using Robotlib

Robotlib is using DataArrays internally.

julia> versioninfo()
Julia Version 0.6.0-rc3.0
Commit ad290e9 (2017-06-07 11:53 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)
julia> Pkg.status("Robotlib")
 - Robotlib                      0.2.0

Beginning of traces

WARNING: An error occurred during inference. Type inference is now partially disabled.
Base.MethodError(f=typeof(Core.Inference.convert)(), args=(Base.AssertionError, "invalid age range update"), world=0x0000000000000ac2)
rec_backtrace at /home/centos/buildbot/slave/package_tarball64/build/src/stackwalk.c:84
record_backtrace at /home/centos/buildbot/slave/package_tarball64/build/src/task.c:245
jl_throw at /home/centos/buildbot/slave/package_tarball64/build/src/task.c:564
jl_method_error_bare at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1476
jl_method_error at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1494
jl_lookup_generic_ at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1907 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1927
Type at ./coreimg.jl:14

.
.
.

#1 at ./event.jl:73
unknown function (ip: 0x7f22965e736f)
jl_call_fptr_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1930
jl_apply at /home/centos/buildbot/slave/package_tarball64/build/src/julia.h:1423 [inlined]
start_task at /home/centos/buildbot/slave/package_tarball64/build/src/task.c:267
unknown function (ip: 0xffffffffffffffff)
SYSTEM: show(lasterr) caused an error
MethodError(Core.Inference.convert, (AssertionError, "invalid age range update"), 0x0000000000000ac2)

Stacktrace:
 [1] (::Type{T})(::Any) at ./coreimg.jl:14
 [2] update_valid_age!(::UInt64, ::UInt64, ::Core.Inference.InferenceState) at ./inference.jl:2363
 [3] add_backedge(::Core.Inference.InferenceState, ::Core.Inference.InferenceState, ::Int64) at ./inference.jl:2448
 [4] typeinf_frame(::Core.MethodInstance, ::Core.Inference.InferenceState, ::Bool, ::Bool, ::Core.Inference.InferenceParams) at ./inference.jl:2492
 [5] typeinf_edge(::Method, ::Any, ::SimpleVector, ::Core.Inference.InferenceState) at ./inference.jl:2517
 [6] abstract_call_gf_by_type(::Any, ::Any, ::Core.Inference.InferenceState) at ./inference.jl:1401
 [7] abstract_call(::Any, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1882
 [8] abstract_eval_call(::Expr, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1912
 [9] abstract_eval(::Any, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1935
 [10] typeinf_frame(::Core.Inference.InferenceState) at ./inference.jl:2778
 [11] typeinf_loop(::Core.Inference.InferenceState) at ./inference.jl:2624
 [12] typeinf_frame(::Core.MethodInstance, ::Core.Inference.InferenceState, ::Bool, ::Bool, ::Core.Inference.InferenceParams) at ./inference.jl:2494

@timholy
Copy link
Member Author

timholy commented Jun 19, 2017

Worth pointing out that this is not fixed by #22340 (I don't think it was intended to fix this, but I thought it was worth testing).

@vtjnash
Copy link
Member

vtjnash commented Jun 19, 2017

I can't reproduce. Can you apply this patch and let us know what it prints?

diff --git a/base/inference.jl b/base/inference.jl
index 6cfb076..79dc7bd 100644
--- a/base/inference.jl
+++ b/base/inference.jl
@@ -2357,14 +2357,23 @@ function converge_valid_age!(sv::InferenceState)
 end
 
 # work towards converging the valid age range for sv
-function update_valid_age!(min_valid::UInt, max_valid::UInt, sv::InferenceState)
+function update_valid_age!(min_valid::UInt, max_valid::UInt, sv::InferenceState, callee=nothing)
+    minv, maxv = sv.min_valid, sv.max_valid
     sv.min_valid = max(sv.min_valid, min_valid)
     sv.max_valid = min(sv.max_valid, max_valid)
+    if !(!isdefined(sv.linfo, :def) || !sv.cached || sv.min_valid <= sv.params.world <= sv.max_valid)
+        println("caller: ", sv.linfo)
+        println("callee: ", callee)
+        println("cached: ", sv.cached)
+        println("bounds: ", sv.min_valid, ", ", sv.params.world, ", ", sv.max_valid)
+        println("original bounds: ", minv, ", ", maxv)
+        println("input bounds: ", min_valid, ", ", max_valid)
+        #print_callstack(sv)
+    end
     @assert !isdefined(sv.linfo, :def) || !sv.cached || sv.min_valid <= sv.params.world <= sv.max_valid "invalid age range update"
     nothing
 end
-update_valid_age!(edge::InferenceState, sv::InferenceState) = update_valid_age!(edge.min_valid, edge.max_valid, sv)
-update_valid_age!(li::MethodInstance, sv::InferenceState) = update_valid_age!(min_world(li), max_world(li), sv)
+update_valid_age!(edge::InferenceState, sv::InferenceState) = update_valid_age!(edge.min_valid, edge.max_valid, sv, edge.linfo)
+update_valid_age!(li::MethodInstance, sv::InferenceState) = update_valid_age!(min_world(li), max_world(li), sv, li)
 
 # temporarily accumulate our edges to later add as backedges in the callee
 function add_backedge(li::MethodInstance, caller::InferenceState)

@timholy
Copy link
Member Author

timholy commented Jun 20, 2017

@vtjnash, if you want access to our private repos, I can send you an invite.

@blegat
Copy link
Contributor

blegat commented Jul 13, 2017

I keep getting this error on Julia v0.6 in DynamicPolynomials, e.g. here and here. However I cannot create a minimal example since whenever I try to remove lines that are unrelated it stop failing. I can send a zip with MultivariatePolynomials and DynamicPolynomials in a failing state if it helps.

@vtjnash
Copy link
Member

vtjnash commented Jul 13, 2017

Does the code work on master?

@blegat
Copy link
Contributor

blegat commented Aug 5, 2017

I have just tested it, it works on 472353c.

@blegat
Copy link
Contributor

blegat commented Aug 6, 2017

Would it help to bisect or do you have an idea of the change in Julia 0.7 that might have fixed this ?

@tkelman
Copy link
Contributor

tkelman commented Aug 7, 2017

A bisect would be helpful I think. I tried checking out a few different branches of these packages and couldn't reproduce.

@blegat
Copy link
Contributor

blegat commented Aug 7, 2017

I have created the packages A.jl and B.jl that are failing (it is just MultivariatePolynomials and DynamicPolynomials renamed in a failing state).
To reproduce, do:

Version 0.6.0 (2017-06-19 13:05 UTC)
x86_64-pc-linux-gnu
julia> Pkg.clone("https://github.com/blegat/A.jl.git")
julia> Pkg.clone("https://github.com/blegat/B.jl.git")
julia> using B
INFO: Precompiling module B.
WARNING: An error occurred during inference. Type inference is now partially disabled.
Base.MethodError(f=typeof(Core.Inference.convert)(), args=(Base.AssertionError, "invalid age range update"), world=0x0000000000000ac2)
unknown function (ip: 0x7fc123746d57)
...

@tkelman
Copy link
Contributor

tkelman commented Aug 8, 2017

I was able to reproduce with that, but bisecting is tricky since there's a big range of the history where using B seems to freeze

@tkelman
Copy link
Contributor

tkelman commented Aug 8, 2017

Applying the patch from #22272 appears to address the freeze, so would be great to reduce these as far as possible to use as a test for that. Bisecting with that patch applied earlier in the history should hopefully be able to tell us what fixed the invalid age range error. points to 753fbef (#21892) as fixing the inference error.

@omus
Copy link
Member

omus commented Aug 9, 2017

I'm still seeing this issue even with the latest 0.7. I've applied @vtjnash's patch and got:

julia> using X
INFO: Recompiling stale cache file /Users/omus/.julia/lib/v0.7/PyCall.ji for module PyCall.
caller: Base.isequal(typeof(Base.isequal), Any, Symbol)
callee: PyCall.==(typeof(Base.:(==)), PyCall.PyObject, Symbol)
cached: true
bounds: 0x0000000000005985, 0x0000000000005985, 0x0000000000000000
original bounds: 0x0000000000005985, 0xffffffffffffffff
input bounds: 0x0000000000000001, 0x0000000000000000
Internal error: encountered unexpected error in runtime:
Base.MethodError(f=typeof(Core.Inference.convert)(), args=(Base.AssertionError, "invalid age range update"), world=0x0000000000000b02)
rec_backtrace at /Users/omus/Development/Julia/latest/src/stackwalk.c:86
record_backtrace at /Users/omus/Development/Julia/latest/src/task.c:246 [inlined]
jl_throw at /Users/omus/Development/Julia/latest/src/task.c:568
jl_method_error_bare at /Users/omus/Development/Julia/latest/src/gf.c:1474
jl_method_error at /Users/omus/Development/Julia/latest/src/gf.c:1492
jl_lookup_generic_ at /Users/omus/Development/Julia/latest/src/gf.c:1906
jl_apply_generic at /Users/omus/Development/Julia/latest/src/gf.c:1926
Type at ./coreimg.jl:16
update_valid_age! at ./inference.jl:2818
add_backedge! at ./inference.jl:2831
...

Unfortunately, the package I'm using which produces this problem isn't open source. I'll try to investigate.

@yuyichao
Copy link
Contributor

yuyichao commented Aug 9, 2017

That's a different issue triggered by PyPlot in precompilation (it triggers an assertion with julia-debug)

Bisected to 7ec9b18. Haven't had time to reduce it yet.

7ec9b1857e029d4307fa0968512f828481611440 is the first bad commit
commit 7ec9b1857e029d4307fa0968512f828481611440
Author: Jameson Nash <[email protected]>
Date:   Mon Jul 24 15:40:37 2017 -0400

    partially fix some macro expansion scope bugs

    fix #22307

:040000 040000 d60d343c10592179e71176cacde0aef53af4f119 b243136cb235e71924bbb1f3e4d688ed01909be1 M base
:040000 040000 a0586a671d1f1e1c62782673cbfb9a4a142dc69b ba070c07127eb4732665a2a05c60aba74aea3329 M src
:040000 040000 7f8dcc073935e22b5e9978e5870aa3fb65c9aafe 03fa0239f329e6dea282969e1d8c241ea2103a3c M test

@iamed2
Copy link
Contributor

iamed2 commented Aug 9, 2017

@yuyichao Do you mean PyCall instead of PyPlot?

@yuyichao
Copy link
Contributor

yuyichao commented Aug 9, 2017

No

@iamed2
Copy link
Contributor

iamed2 commented Aug 9, 2017

In Curtis' example, PyPlot is not used by X or its dependencies (I have access to the closed source package).

@yuyichao
Copy link
Contributor

yuyichao commented Aug 9, 2017

So?

@iamed2
Copy link
Contributor

iamed2 commented Aug 9, 2017

That's a different issue triggered by PyPlot in precompilation (it triggers an assertion with julia-debug)

How could PyPlot have triggered this if PyPlot was never used?

@yuyichao
Copy link
Contributor

yuyichao commented Aug 9, 2017

Because the issue is clearly PyCall related even though loading the package itself doesn't. It also shows the same error in type inference.

@iamed2
Copy link
Contributor

iamed2 commented Aug 9, 2017

So you do mean PyCall and not PyPlot?

@yuyichao
Copy link
Contributor

yuyichao commented Aug 9, 2017

No I mean PyPlot since importing it is how I can (and how anyone that actually want to look into this can) reproduce this issue, especially after enabling assertion, even though I'm pretty sure it is related to code in PyCall.

Not sure what you are trying to argue.

@iamed2
Copy link
Contributor

iamed2 commented Aug 9, 2017

Ohhh I see. To me, it sounded like you were saying that something in PyPlot was the root cause of Curtis' issue. Now I understand that you were not saying that.

Not trying to argue, just trying to understand what you were saying :)

@blegat
Copy link
Contributor

blegat commented Oct 27, 2017

Has this been backported in to Julia v0.6.1 ?

@ViralBShah
Copy link
Member

@ararslan I assume you remove the backport pending label if you port it back, right? That means if the label is still on, it is indeed pending and would go into the next one.

@blegat
Copy link
Contributor

blegat commented Oct 28, 2017

I have just tested the Julia v0.6.1 64 bits linux binaries, the bug is indeed still there 😢

@ararslan
Copy link
Member

@ViralBShah Correct. If the label is there, it's still pending.

@StefanKarpinski
Copy link
Member

Is this still an issue or is this moot now?

@vtjnash
Copy link
Member

vtjnash commented Apr 18, 2019

I rewrote these code paths pretty significantly in #31191, so I'd say moot.

@vtjnash vtjnash closed this as completed Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

No branches or pull requests