JuliaDebug / Cthulhu.jl

The slow descent into madness
MIT License
650 stars 41 forks source link

AssertionError: remarks found in unreached region #325

Open thchr opened 2 years ago

thchr commented 2 years ago

To reproduce (loaded with Revise and current Pkg.jl master):

julia> using SnoopCompileCore
julia> invalidations = @snoopr using StaticArrays;
julia> using SnoopCompile, Cthulhu
julia> trees = invalidation_trees(invalidations)
julia> mi = trees[end-3]
inserting getindex(sa::Type{SA}, xs...) @ StaticArrays ~/.julia/packages/StaticArrays/68nRv/src/initializers.jl:31 invalidated:
   backedges: 1: superseding getindex(::Type{T}, vals...) where T @ Base array.jl:399 with MethodInstance for getindex(::Type, ::Nothing, ::Vararg{String}) (11 children)

julia> root = mi.backedges[1]
MethodInstance for getindex(::Type, ::Nothing, ::Vararg{String}) at depth 0 with 11 children

julia> ascend(root)
Choose a call for analysis (q to quit):
     getindex(::Type, ::Nothing, ::Vararg{String})
       vect(::Nothing, ::Vararg{String})
 >       #build_versions#60(::Bool, ::typeof(Pkg.Operations.build_versions), ::Pkg.Types.Context, ::Set{Base.UUID})
           build_versions(::Pkg.Types.Context, ::Set{Base.UUID})
             #up#98(::Bool, ::Nothing, ::typeof(Pkg.Operations.up), ::Pkg.Types.Context, ::Vector{Pkg.Types.PackageSpec}, ::Pkg.Types
             #add#85(::Pkg.Types.PreserveLevel, ::Base.BinaryPlatforms.Platform, ::typeof(Pkg.Operations.add), ::Pkg.Types.Context, :
             #add#85(::Pkg.Types.PreserveLevel, ::Base.BinaryPlatforms.AbstractPlatform, ::typeof(Pkg.Operations.add), ::Pkg.Types.Co
             #up#98(::Bool, ::Pkg.Types.PreserveLevel, ::typeof(Pkg.Operations.up), ::Pkg.Types.Context, ::Vector{Pkg.Types.PackageSp
             #develop#92(::Pkg.Types.PreserveLevel, ::Base.BinaryPlatforms.Platform, ::typeof(Pkg.Operations.develop), ::Pkg.Types.Co
v            #develop#92(::Pkg.Types.PreserveLevel, ::Base.BinaryPlatforms.AbstractPlatform, ::typeof(Pkg.Operations.develop), ::Pkg.

Pressing 'Enter' at the third line (or fourth) (i.e., the #build_versions#60 ... line), then produces an assertion error (from here):

ERROR: AssertionError: remarks found in unreached region
Full stacktrace ```jl ERROR: AssertionError: remarks found in unreached region Stacktrace: [1] type_annotate!(interp::Cthulhu.CthulhuInterpreter, sv::Core.Compiler.InferenceState, run_optimizer::Bool) @ Cthulhu ~/.julia/packages/Cthulhu/FQfFD/src/interpreter.jl:99 [2] finish(me::Core.Compiler.InferenceState, interp::Cthulhu.CthulhuInterpreter) @ Core.Compiler ./compiler/typeinfer.jl:546 [3] finish(state::Core.Compiler.InferenceState, interp::Cthulhu.CthulhuInterpreter) @ Cthulhu ~/.julia/packages/Cthulhu/FQfFD/src/interpreter.jl:130 [4] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:245 [5] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [6] typeinf_edge(interp::Cthulhu.CthulhuInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:937 [7] abstract_call_method(interp::Cthulhu.CthulhuInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:613 [8] abstract_call_gf_by_type(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:152 [9] abstract_call_known(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:1834 [10] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:1905 [11] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:1884 [12] abstract_eval_statement_expr(interp::Cthulhu.CthulhuInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:2035 [13] abstract_eval_statement(interp::Cthulhu.CthulhuInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2248 [14] abstract_eval_basic_statement(interp::Cthulhu.CthulhuInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2442 [15] typeinf_local(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2617 [16] typeinf_nocycle(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2723 [17] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:232 --- the last 13 lines are repeated 1 more time --- [31] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [32] typeinf_edge(interp::Cthulhu.CthulhuInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:937 [33] abstract_call_method(interp::Cthulhu.CthulhuInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:613 [34] abstract_call_gf_by_type(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:152 [35] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:1902 [36] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:1884 [37] abstract_eval_statement_expr(interp::Cthulhu.CthulhuInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:2035 [38] abstract_eval_statement(interp::Cthulhu.CthulhuInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2248 [39] abstract_eval_basic_statement(interp::Cthulhu.CthulhuInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2442 [40] typeinf_local(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2617 [41] typeinf_nocycle(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2723 [42] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:232 [43] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [44] typeinf_edge(interp::Cthulhu.CthulhuInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:937 [45] abstract_call_method(interp::Cthulhu.CthulhuInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:613 [46] abstract_call_gf_by_type(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:152 [47] abstract_call_known(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:1834 [48] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:1905 [49] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:1884 [50] abstract_eval_statement_expr(interp::Cthulhu.CthulhuInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:2035 [51] abstract_eval_statement(interp::Cthulhu.CthulhuInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2248 [52] abstract_eval_basic_statement(interp::Cthulhu.CthulhuInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2418 --- the last 13 lines are repeated 1 more time --- [66] typeinf_local(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2617 [67] typeinf_nocycle(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2723 [68] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:232 [69] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [70] typeinf_edge(interp::Cthulhu.CthulhuInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:937 [71] abstract_call_method(interp::Cthulhu.CthulhuInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:613 [72] abstract_call_gf_by_type(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:152 [73] abstract_call_known(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:1834 [74] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:1905 [75] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:1884 [76] abstract_eval_statement_expr(interp::Cthulhu.CthulhuInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:2035 [77] abstract_eval_statement(interp::Cthulhu.CthulhuInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2248 [78] abstract_eval_basic_statement(interp::Cthulhu.CthulhuInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2442 --- the last 13 lines are repeated 3 more times --- --- the last 65 lines are repeated 1 more time --- [183] typeinf_local(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2617 [184] typeinf_nocycle(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2723 [185] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:232 [186] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [187] typeinf_edge(interp::Cthulhu.CthulhuInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:937 [188] abstract_call_method(interp::Cthulhu.CthulhuInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:613 [189] abstract_call_gf_by_type(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:152 [190] abstract_call_known(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:1834 [191] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:1905 [192] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:1884 [193] abstract_eval_statement_expr(interp::Cthulhu.CthulhuInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:2035 [194] abstract_eval_statement(interp::Cthulhu.CthulhuInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2248 [195] abstract_eval_basic_statement(interp::Cthulhu.CthulhuInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2442 --- the last 13 lines are repeated 3 more times --- [235] typeinf_local(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2617 [236] typeinf_nocycle(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2723 [237] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:232 [238] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [239] typeinf_edge(interp::Cthulhu.CthulhuInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:937 [240] abstract_call_method(interp::Cthulhu.CthulhuInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:613 [241] abstract_call_gf_by_type(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:152 [242] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:1902 [243] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:1884 [244] abstract_eval_statement_expr(interp::Cthulhu.CthulhuInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:2035 [245] abstract_eval_statement(interp::Cthulhu.CthulhuInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2248 [246] abstract_eval_basic_statement(interp::Cthulhu.CthulhuInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2418 [247] typeinf_local(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2617 [248] typeinf_nocycle(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2723 [249] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:232 [250] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [251] typeinf_edge(interp::Cthulhu.CthulhuInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:937 [252] abstract_call_method(interp::Cthulhu.CthulhuInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:613 [253] abstract_call_gf_by_type(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:152 [254] abstract_call_known(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:1834 [255] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:1905 [256] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:1884 [257] abstract_eval_statement_expr(interp::Cthulhu.CthulhuInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:2035 [258] abstract_eval_statement(interp::Cthulhu.CthulhuInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2248 [259] abstract_eval_basic_statement(interp::Cthulhu.CthulhuInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2442 --- the last 25 lines are repeated 1 more time --- [285] typeinf_local(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2617 [286] typeinf_nocycle(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2723 [287] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:232 [288] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [289] typeinf_edge(interp::Cthulhu.CthulhuInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:937 [290] abstract_call_method(interp::Cthulhu.CthulhuInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:613 [291] abstract_call_gf_by_type(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:152 [292] abstract_call_known(interp::Cthulhu.CthulhuInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Int64) @ Core.Compiler ./compiler/abstractinterpretation.jl:1834 [293] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:1905 [294] abstract_call(interp::Cthulhu.CthulhuInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:1884 [295] abstract_eval_statement_expr(interp::Cthulhu.CthulhuInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing) @ Core.Compiler ./compiler/abstractinterpretation.jl:2035 [296] abstract_eval_statement(interp::Cthulhu.CthulhuInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2248 [297] abstract_eval_basic_statement(interp::Cthulhu.CthulhuInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2442 --- the last 13 lines are repeated 3 more times --- [337] typeinf_local(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2617 [338] typeinf_nocycle(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/abstractinterpretation.jl:2723 [339] _typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:232 [340] typeinf(interp::Cthulhu.CthulhuInterpreter, frame::Core.Compiler.InferenceState) @ Core.Compiler ./compiler/typeinfer.jl:215 [341] do_typeinf!(interp::Cthulhu.CthulhuInterpreter, mi::Core.MethodInstance) @ Cthulhu ~/.julia/packages/Cthulhu/FQfFD/src/Cthulhu.jl:705 [342] find_caller_of(interp::Core.Compiler.NativeInterpreter, callee::Core.MethodInstance, caller::Core.MethodInstance; allow_unspecialized::Bool) @ Cthulhu ~/.julia/packages/Cthulhu/FQfFD/src/reflection.jl:303 [343] ascend(term::REPL.Terminals.TTYTerminal, mi::SnoopCompile.InstanceNode; interp::Core.Compiler.NativeInterpreter, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ Cthulhu ~/.julia/packages/Cthulhu/FQfFD/src/Cthulhu.jl:770 [344] ascend(term::REPL.Terminals.TTYTerminal, mi::SnoopCompile.InstanceNode) @ Cthulhu ~/.julia/packages/Cthulhu/FQfFD/src/Cthulhu.jl:756 [345] ascend(mi::SnoopCompile.InstanceNode; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ Cthulhu ~/.julia/packages/Cthulhu/FQfFD/src/Cthulhu.jl:797 [346] ascend(mi::SnoopCompile.InstanceNode) @ Cthulhu ~/.julia/packages/Cthulhu/FQfFD/src/Cthulhu.jl:797 ```

julia> versioninfo()
Julia Version 1.9.0-DEV.1345
Commit 70bfa3fe09c (2022-09-13 12:08 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.5 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores

pkg> st
...
  [f68482b8] Cthulhu v2.7.2
...
thchr commented 2 years ago

Doesn't seem to actually require recent Pkg.jl, so the reproducer can be simplified a bit to just:

julia> using SnoopCompileCore
julia> invalidations = @snoopr using StaticArrays;
julia> using SnoopCompile, Cthulhu
julia> trees = invalidation_trees(invalidations)
julia> mi = trees[end]
inserting getindex(sa::Type{SA}, xs...) @ StaticArrays ~/.julia/packages/StaticArrays/68nRv/src/initializers.jl:31 invalidated:
   backedges: 1: superseding getindex(::Type{T}, vals...) where T @ Base array.jl:399 with MethodInstance for getindex(::Type, ::Nothing, ::Vararg{String}) (119 children)

julia> root = mi.backedges[1];
julia> ascend(root)
Choose a call for analysis (q to quit):
     getindex(::Type, ::Nothing, ::Vararg{String})
       vect(::Nothing, ::Vararg{String})
 >       #build_versions#60(::Bool, ::typeof(Pkg.Operations.build_versions), ::Pkg.Types.Context, ::Set{Base.UUID})
           build_versions(::Pkg.Types.Context, ::Set{Base.UUID})

Calling the #build_versions# ... or build_versions ... lines gives the assertion error again.