WARNING: An error occurred during inference

nightly

#1

I have a seemingly simple program, 280 lines data processing, not numeric, that when it runs, produces a lengthy stack trace starting with the above message. The stack trace is

WARNING: An error occurred during inference. Type inference is now partially disabled.
TypeError(func=:subtype, context="", expected=Type, got=1)
rec_backtrace at /ian/pub/julia/src/stackwalk.c:84
record_backtrace at /ian/pub/julia/src/task.c:232
jl_throw at /ian/pub/julia/src/task.c:550
jl_type_error_rt at /ian/pub/julia/src/builtins.c:119
jl_type_error at /ian/pub/julia/src/builtins.c:125
jl_f_issubtype at /ian/pub/julia/src/builtins.c:386
typeseq at ./reflection.jl:120 [inlined]
record_slot_type! at ./inference.jl:2021
unknown function (ip: 0x7f75fdc8b319)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
eval_annotate at ./inference.jl:2037
unknown function (ip: 0x7f75fdc763c1)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
eval_annotate at ./inference.jl:2060
unknown function (ip: 0x7f75fdc763c1)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
eval_annotate at ./inference.jl:2053
unknown function (ip: 0x7f75fdc763c1)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
type_annotate! at ./inference.jl:2092
finish at ./inference.jl:1924
unknown function (ip: 0x7f75fdc6756b)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
typeinf_loop at ./inference.jl:1686
unknown function (ip: 0x7f75fdc69f4b)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
typeinf_edge at ./inference.jl:1592
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
typeinf_ext at ./inference.jl:1616
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
jl_apply at /ian/pub/julia/src/julia.h:1392 [inlined]
jl_type_infer at /ian/pub/julia/src/gf.c:213
jl_compile_for_dispatch at /ian/pub/julia/src/gf.c:1298
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:184 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
do_call at /ian/pub/julia/src/interpreter.c:66
eval at /ian/pub/julia/src/interpreter.c:190
jl_toplevel_eval_flex at /ian/pub/julia/src/toplevel.c:558 [inlined]
jl_toplevel_eval at /ian/pub/julia/src/toplevel.c:580
jl_toplevel_eval_in_warn at /ian/pub/julia/src/builtins.c:590
eval at ./boot.jl:234
unknown function (ip: 0x7f75fdd802cf)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
eval_user_input at ./REPL.jl:64
unknown function (ip: 0x7f73fb47ead6)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
macro expansion at ./REPL.jl:95 [inlined]
#3 at ./event.jl:68
unknown function (ip: 0x7f73fb47bf0f)
jl_call_method_internal at /ian/pub/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /ian/pub/julia/src/gf.c:1950
jl_apply at /ian/pub/julia/src/julia.h:1392 [inlined]
start_task at /ian/pub/julia/src/task.c:253
unknown function (ip: 0xffffffffffffffff)

julia> versioninfo()
Julia Version 0.5.1-pre+55
Commit 8d4ef37* (2017-02-13 09:11 UTC)
Platform Info:
  System: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU           X5675  @ 3.07GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, westmere)

The code uses DataFrames so I cannot test with version 0.6. I could post the code and some dummy data if that would help…

The code then runs OK, but I’ll guess that error should not be occurring. Presumably something in my code is wrong in some way, although it seems to be producing valid results.

Thanks

Ian


#2

This error is coming from inside Julia compiler; it tries to infer types in order to optimise the program, but that’s apparently broken. What this means is that your code is going to run slowly, but the output shouldn’t change.

Someone more involved with type inference might have steps to debug this issue so it can be fixed in Julia itself (or may already know about it).


#3

It’s always worthwhile to file issues for these things. If you can post the code and sample data, that’s great.


#4

Just to note. This is labelled with “usage” and “first steps”. These labels should not be applied to discussions about using the nightly builds. It should be well understand that first time users should not be using nightly build, which right now is v0.6.

Here you can see that you ran into a compiler error since you’re on an unreleased build of Julia. This is of interest to developers, and you should file bug reports. But if you’re really just doing your “first steps” into Julia, note that this is not indicative of actual Julia releases.


#5

Same issue showed up here. Doesn’t happen on nightly and can’t reproduce outside of travis, unfortunately.