-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Original Discouse discussion (only for history, no extra relevant info there).
The following was obtained using Julia 1.6.0-beta1, this version was chosen to be able to use the --bug-report=rr flag, but the problem also happens in 1.5.3 (other versions not tested). I used a clean .julia for this (i.e., moved the old folder somewhere else before the command below).
Reproduction:
$ git clone https://github.com/henriquebecker91/GuillotineModels.jl
$ cd GuillotineModels.jl/examples
$ git checkout 2c979b7f # commit that I am sure to have the problem
$ wget https://pastebin.com/raw/pUWn5BJP # toy instance of my problem, needed for the called function
$ julia-1.6.0-beta1 --project=@.
julia> import Pkg
julia> Pkg.instantiate() # instantiate and get out to not pollute the logs
$ julia-1.6.0-beta1 --project=@. --bug-report=rr # first time it installs rr but fails, maybe do not play nice with --project=@. ?
$ julia-1.6.0-beta1 --project=@. --bug-report=rr # second time it works
julia> import Pkg
julia> Pkg.activate(".") # --project=@. really does not play nice with --bug-report=rr, I need to activate the Project manually
julia> using GuillotineModels, GLPK
julia> GuillotineModels.CommandLine.run(["G2CSP", "CPG_SSSCSP", "PPG2KP", "GLPK", "./pUWn5BJP", "--do-not-solve"])
The result is a very long error (but that mostly repeats itself starting with):
Internal error: encountered unexpected error in runtime:
StackOverflowError()
init_stenv at /buildworker/worker/package_linux64/build/src/subtype.c:1484 [inlined]
subtype_in_env_ at /buildworker/worker/package_linux64/build/src/subtype.c:1898
subtype_bounds_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:1917 [inlined]
try_subtype_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:2200 [inlined]
intersect_var at /buildworker/worker/package_linux64/build/src/subtype.c:2313
intersect at /buildworker/worker/package_linux64/build/src/subtype.c:3023
intersect_all at /buildworker/worker/package_linux64/build/src/subtype.c:3170
intersect_aside at /buildworker/worker/package_linux64/build/src/subtype.c:2147
intersect_var at /buildworker/worker/package_linux64/build/src/subtype.c:2316
intersect at /buildworker/worker/package_linux64/build/src/subtype.c:3023
intersect_all at /buildworker/worker/package_linux64/build/src/subtype.c:3170
intersect_aside at /buildworker/worker/package_linux64/build/src/subtype.c:2147
intersect_var at /buildworker/worker/package_linux64/build/src/subtype.c:2316
intersect at /buildworker/worker/package_linux64/build/src/subtype.c:3016
intersect_all at /buildworker/worker/package_linux64/build/src/subtype.c:3170
intersect_aside at /buildworker/worker/package_linux64/build/src/subtype.c:2147
var_lt at /buildworker/worker/package_linux64/build/src/subtype.c:589
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1256
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1254
subtype_tuple_tail at /buildworker/worker/package_linux64/build/src/subtype.c:1085
subtype_tuple at /buildworker/worker/package_linux64/build/src/subtype.c:1168 [inlined]
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1323
with_tvar at /buildworker/worker/package_linux64/build/src/subtype.c:745
subtype_unionall at /buildworker/worker/package_linux64/build/src/subtype.c:839 [inlined]
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1282
exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1426 [inlined]
forall_exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1454
subtype_in_env_ at /buildworker/worker/package_linux64/build/src/subtype.c:1907
subtype_bounds_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:1917 [inlined]
try_subtype_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:2200 [inlined]
intersect_var at /buildworker/worker/package_linux64/build/src/subtype.c:2313
intersect at /buildworker/worker/package_linux64/build/src/subtype.c:3019
intersect_all at /buildworker/worker/package_linux64/build/src/subtype.c:3170
intersect_aside at /buildworker/worker/package_linux64/build/src/subtype.c:2147
var_lt at /buildworker/worker/package_linux64/build/src/subtype.c:589
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1256
exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1426 [inlined]
forall_exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1454
subtype_in_env_ at /buildworker/worker/package_linux64/build/src/subtype.c:1907
subtype_bounds_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:1917 [inlined]
try_subtype_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:2200 [inlined]
intersect_var at /buildworker/worker/package_linux64/build/src/subtype.c:2313
intersect at /buildworker/worker/package_linux64/build/src/subtype.c:3019
intersect_all at /buildworker/worker/package_linux64/build/src/subtype.c:3170
intersect_aside at /buildworker/worker/package_linux64/build/src/subtype.c:2147
var_lt at /buildworker/worker/package_linux64/build/src/subtype.c:589
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1256
exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1426 [inlined]
forall_exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1454
...
It is interesting that after printing all the error message, the code continue executing, I have the output of some @shows of my code, and then inference fails again, this time ending with:
abstract_call_method at ./compiler/abstractinterpretation.jl:478
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:141
abstract_call at ./compiler/abstractinterpretation.jl:1036
abstract_call at ./compiler/abstractinterpretation.jl:1022
abstract_eval_statement at ./compiler/abstractinterpretation.jl:1144
typeinf_local at ./compiler/abstractinterpretation.jl:1383
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1454
_typeinf at ./compiler/typeinfer.jl:216
typeinf at ./compiler/typeinfer.jl:211
typeinf_edge at ./compiler/typeinfer.jl:745
abstract_call_method at ./compiler/abstractinterpretation.jl:478
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:141
abstract_call_known at ./compiler/abstractinterpretation.jl:1015
abstract_call at ./compiler/abstractinterpretation.jl:1038
abstract_call at ./compiler/abstractinterpretation.jl:1022
abstract_eval_statement at ./compiler/abstractinterpretation.jl:1144
typeinf_local at ./compiler/abstractinterpretation.jl:1398
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1454
_typeinf at ./compiler/typeinfer.jl:216
typeinf at ./compiler/typeinfer.jl:211
typeinf_ext at ./compiler/typeinfer.jl:835
typeinf_ext_toplevel at ./compiler/typeinfer.jl:868
typeinf_ext_toplevel at ./compiler/typeinfer.jl:864
jfptr_typeinf_ext_toplevel_10360.clone_1 at /opt/julia-1.6.0-beta1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
jl_type_infer at /buildworker/worker/package_linux64/build/src/gf.c:296
jl_generate_fptr at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:340
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/gf.c:1957
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/gf.c:2223 [inlined]
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2216 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
macro expansion at ./timing.jl:279 [inlined]
macro expansion at /home/henrique/AreaDeTrabalho/julia_bug_stackoverflow/GuillotineModels.jl/src/CommandLine.jl:874 [inlined]
#26 at /home/henrique/.julia/packages/TimerOutputs/ZmKD7/src/TimerOutput.jl:237
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
timeit at /home/henrique/.julia/packages/TimerOutputs/ZmKD7/src/TimerOutput.jl:285
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
#run#25 at /home/henrique/.julia/packages/TimerOutputs/ZmKD7/src/TimerOutput.jl:236
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
run at /home/henrique/.julia/packages/TimerOutputs/ZmKD7/src/TimerOutput.jl:254
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:115
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:204
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:155 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:561
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:669
top-level scope at REPL[8]:1
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:879
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:827
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:931
eval at ./boot.jl:360
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:139
repl_backend_loop at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:200
start_repl_backend at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:185
#run_repl#42 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:317
run_repl at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:305
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
#875 at ./client.jl:387
jfptr_YY.875_36004.clone_1 at /opt/julia-1.6.0-beta1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
do_apply at /buildworker/worker/package_linux64/build/src/builtins.c:672
jl_f__apply_latest at /buildworker/worker/package_linux64/build/src/builtins.c:722
#invokelatest#2 at ./essentials.jl:707 [inlined]
invokelatest at ./essentials.jl:706 [inlined]
run_main_repl at ./client.jl:372
exec_options at ./client.jl:302
_start at ./client.jl:485
jfptr__start_40814.clone_1 at /opt/julia-1.6.0-beta1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2224 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2406
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:557
repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:699
main at /buildworker/worker/package_linux64/build/cli/loader_exe.c:51
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
_start at /opt/julia-1.6.0-beta1/bin/julia (unknown line)
instfname = "./pUWn5BJP"
┌ Warning: Could not match the header pattern for format:
│ GuillotineModels.Data.CPG_SSSCSP{Int64, Int64, Int64}()
│ ; this is:
│ r"\*\*\*2D Rectangular Problem\*\*\*
│ \*\*\*Instances for the Single Stock Size Cutting Stock Problem \(SSSCSP\)\*\*\*
│ Input parameter file:[^\n]*
│ ^\*+$
│ .*
│ ^\*+$"ims
└ @ GuillotineModels.Data ~/AreaDeTrabalho/julia_bug_stackoverflow/GuillotineModels.jl/src/Data/cpg.jl:111
ERROR: Trying to parse GuillotineModels.Data.CPG_SSSCSP{Int64, Int64, Int64}() has resulted in the following error: Parser expects to find two lines only with asterisks; found 0 line(s) like this. As the data should be after the second of these lines, the parser did not start gathering data.
Stacktrace:
[1] _find_header_end(format::GuillotineModels.Data.CPG_SSSCSP{Int64, Int64, Int64}, lines::Vector{SubString{String}})
@ GuillotineModels.Data ~/AreaDeTrabalho/julia_bug_stackoverflow/GuillotineModels.jl/src/Data/cpg.jl:131Another interesting thing is that this error at the end ERROR: Trying to parse GuillotineModels.Data.CPG_SSSCSP ... that comes from my code is incorrect. If you look at the pUWn5BJP file it has two lines of asterisks (and the code used to trigger this exception is correct, I will verify it further, but it is already tested code), so the inference error seem to not only pollute the output but also to trigger undefined behavior on the code that will be evaluated after it stack overflows.
The trace from --bug-report=rr was uploaded touploaded to https://s3.amazonaws.com/julialang-dumps/reports/2021-01-31T14-38-18-henriquebecker91.tar.zst, unfortunately I do not know how to read it.
I really need to have this code working (it is for my PhD that I am trying to finish in the next months), so I am open to make any extra tests necessary and even try to contribute to the solution (while it seems to be something kinda out of my area and abilities). I will probably try to isolate the problem more, or poke around to see if commenting a small part of the code can remove the inference StackOverflowError.