Julia: "AssertionError: stmt_val !== nothing" in compiler

Created on 25 Jun 2018  Â·  5Comments  Â·  Source: JuliaLang/julia

The following error occurs in v0.7.-beta, but did not occur up to and including v0.7.0-alpha.

git bisect points to commit a0de85d866557f5d4d505c232b1aa3f4053cddfb.

ERROR: LoadError: AssertionError: stmt_val !== nothing
Stacktrace:
 [1] perform_lifting!(::Core.Compiler.IncrementalCompact, ::Array{Any,1}, ::Any, ::Core.Compiler.IdDict{Core.Compiler.Pair{Union{Core.Compiler.NewSSAValue, Core.Compiler.OldSSAValue, Core.SSAValue},Any},Union{Core.Compiler.NewSSAVa
lue, Core.Compiler.OldSSAValue, Core.SSAValue}}, ::Any, ::Core.Compiler.IdDict{Any,Any}, ::Any) at ./compiler/ssair/passes.jl:483
 [2] getfield_elim_pass!(::Core.Compiler.IRCode, ::Core.Compiler.DomTree) at ./compiler/ssair/passes.jl:660
 [3] run_passes(::Core.CodeInfo, ::Int64, ::Core.Compiler.OptimizationState) at ./compiler/ssair/driver.jl:123
 [4] optimize(::Core.Compiler.OptimizationState, ::Any) at ./compiler/optimize.jl:146
 [5] typeinf(::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:35
 [6] typeinf_edge(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:544
 [7] abstract_call_method(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:303
 [8] abstract_call_gf_by_type(::Any, ::Array{Any,1}, ::Any, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:78
 [9] abstract_call(::Any, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:709
 [10] abstract_eval_call(::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:738
 [11] abstract_eval(::Any, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:825
 [12] typeinf_local(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1035
 [13] typeinf_nocycle(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1105
 [14] typeinf(::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:15
 [15] typeinf_edge(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:544
 [16] abstract_call_method(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:303
 [17] abstract_call_gf_by_type(::Any, ::Array{Any,1}, ::Any, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:78
 [18] abstract_call(::Any, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:709
 [19] abstract_eval_call(::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:738
 [20] abstract_eval(::Any, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:825
 [21] typeinf_local(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1049
 [22] typeinf_nocycle(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1105
 [23] typeinf(::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:15
 [24] typeinf_edge(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:544
 [25] abstract_call_method(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:303
 [26] abstract_call_gf_by_type(::Any, ::Array{Any,1}, ::Any, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:78
 [27] abstract_call(::Any, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:709
 [28] abstract_eval_call(::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:738
 [29] abstract_eval(::Any, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:825
 [30] typeinf_local(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1049
 [31] typeinf_nocycle(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1105
 [32] typeinf(::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:15
 [33] typeinf_edge(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:544
 [34] abstract_call_method(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:303
 [35] abstract_call_gf_by_type(::Any, ::Array{Any,1}, ::Any, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:78
 [36] abstract_call(::Any, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:709
 [37] abstract_eval_call(::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:738
 [38] abstract_eval(::Any, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:825
 [39] typeinf_local(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1049
 [40] typeinf_nocycle(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1105
 [41] typeinf(::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:15
 [42] typeinf_edge(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:544
 [43] abstract_call_method(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:303
 [44] abstract_call_gf_by_type(::Any, ::Array{Any,1}, ::Any, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:78
 [45] abstract_call(::Any, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:709
 [46] abstract_eval_call(::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:738
 [47] abstract_eval(::Any, ::Array{Any,1}, ::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:825
 [48] typeinf_local(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1049
 [49] typeinf_nocycle(::Core.Compiler.InferenceState) at ./compiler/abstractinterpretation.jl:1105
 [50] typeinf(::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:15
 [51] typeinf_edge(::Method, ::Any, ::Core.SimpleVector, ::Core.Compiler.InferenceState) at ./compiler/typeinfer.jl:544
optimizer

Most helpful comment

I have a handle on this. Fix incoming.

All 5 comments

Having a test case that reproduces this would be great. Otherwise we're just taking shots in the dark.

Sure! Unfortunately this occurs in a large internal codebase, I will try to reduce this into an test case.

@Keno I could isolate it to the LMDB package. Could you please try cloning https://github.com/rened/LMDB.jl.git and running the unit tests? They pass with 0.7 alpha but crash in the beta.

The error occurs in the ccall in

function start(env::Environment; flags::Cuint=zero(Cuint),
               parent::Nullable{Transaction} = Nullable{Transaction}())
    txn_ref = Ref{Ptr{Nothing}}(C_NULL)
    ret = ccall( (:mdb_txn_begin, liblmdb), Cint,
                  (Ptr{Nothing}, Ptr{Nothing}, Cuint, Ptr{Ptr{Nothing}}),
                   env.handle, get(parent, Transaction()).handle,  flags, txn_ref)
    (ret != 0) && throw(LMDBError(ret))
    return Transaction(txn_ref[])
end

which is meant to call int mdb_txn_begin (MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **txn). Is this way of specifying the ccall parameters no longer correct?

I have a handle on this. Fix incoming.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StefanKarpinski picture StefanKarpinski  Â·  3Comments

manor picture manor  Â·  3Comments

iamed2 picture iamed2  Â·  3Comments

tkoolen picture tkoolen  Â·  3Comments

i-apellaniz picture i-apellaniz  Â·  3Comments