Julia crashed when using Gurobi

Z_M
Wed, 06 Aug 2025 12:11:15 +0000
Optimization (Mathematical)

I used JuMP and use Gurobi.
But julia crashed, and the log is as follows:

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffdfd411fe8 -- typekeyvalue_hash at C:/workdir/src\jltypes.c:1365 [inlined]
lookup_typevalue at C:/workdir/src\jltypes.c:891
in expression starting at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\debugger\run_debugger.jl:13
typekeyvalue_hash at C:/workdir/src\jltypes.c:1365 [inlined]
lookup_typevalue at C:/workdir/src\jltypes.c:891
jl_inst_arg_tuple_type at C:/workdir/src\jltypes.c:1807
arg_type_tuple at C:/workdir/src\gf.c:2100 [inlined]
jl_lookup_generic_ at C:/workdir/src\gf.c:2884
ijl_apply_generic at C:/workdir/src\gf.c:2936
#57 at C:\Users\Administrator\.julia\packages\Gurobi\PWFKA\src\MOI_wrapper\MOI_callbacks.jl:38
reenable_sigint at .\c.jl:487 [inlined]
_gurobi_callback_wrapper at C:\Users\Administrator\.julia\packages\Gurobi\PWFKA\src\MOI_wrapper\MOI_callbacks.jl:36
jfptr__gurobi_callback_wrapper_926 at C:\Users\Administrator\.julia\compiled\v1.9\Gurobi\do9v6_VpF9I_1.dll (unknown line)
jlcapi__gurobi_callback_wrapper_1140 at C:\Users\Administrator\.julia\compiled\v1.9\Gurobi\do9v6_VpF9I_1.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBdelconstrs at C:\Users\Administrator\.julia\artifacts\e6550b9416d76c48d61f46fc45c0e3526d04cafd\gurobi120.dll (unknown line)
GRBoptimize at C:\Users\Administrator\.julia\packages\Gurobi\PWFKA\src\gen120\libgrb_api.jl:1196 [inlined]
#34 at C:\Users\Administrator\.julia\packages\Gurobi\PWFKA\src\MOI_wrapper\MOI_wrapper.jl:2816 [inlined]
disable_sigint at .\c.jl:473 [inlined]
optimize! at C:\Users\Administrator\.julia\packages\Gurobi\PWFKA\src\MOI_wrapper\MOI_wrapper.jl:2815
optimize! at C:\Users\Administrator\.julia\packages\MathOptInterface\vK6dk\src\Bridges\bridge_optimizer.jl:367 [inlined]
optimize! at C:\Users\Administrator\.julia\packages\MathOptInterface\vK6dk\src\Utilities\cachingoptimizer.jl:379
jfptr_optimizeNOT._1377 at C:\Users\Administrator\.julia\compiled\v1.9\Gurobi\do9v6_VpF9I_1.dll (unknown line)
#optimize!#105 at C:\Users\Administrator\.julia\packages\JuMP\LeM1m\src\optimizer_interface.jl:609
optimize! at C:\Users\Administrator\.julia\packages\JuMP\LeM1m\src\optimizer_interface.jl:560 [inlined]
#354 at c:\Users\mz\Desktop\fuwuqi\module car_rental_fuc_temp.jl:2673
RedirectStdStream at .\stream.jl:1429
#353 at c:\Users\mz\Desktop\fuwuqi\module car_rental_fuc_temp.jl:2653 [inlined]
#open#409 at .\io.jl:395
open at .\io.jl:392 [inlined]
CP_Main at c:\Users\mz\Desktop\fuwuqi\module car_rental_fuc_temp.jl:2652
unknown function (ip: 0000000000d742f4)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:774
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
do_apply at C:/workdir/src\builtins.c:730
#invokelatest#2 at .\essentials.jl:816
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
do_apply at C:/workdir/src\builtins.c:730
invokelatest at .\essentials.jl:813
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
do_apply at C:/workdir/src\builtins.c:730
native_call at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\interpret.jl:237 [inlined]
#evaluate_call_compiled!#64 at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\interpret.jl:248
evaluate_call_compiled! at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\interpret.jl:240 [inlined]
eval_rhs at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\interpret.jl:423
step_expr! at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\interpret.jl:586
step_expr! at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\interpret.jl:646
finish! at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
jfptr_finish_and_returnNOT._1072 at C:\Users\Administrator\.julia\compiled\v1.9\VSCodeDebugger\xYOi8_VpF9I.dll (unknown line)
finish_stack! at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\commands.jl:60
jfptr_finish_stackNOT._1209 at C:\Users\Administrator\.julia\compiled\v1.9\VSCodeDebugger\xYOi8_VpF9I.dll (unknown line)
#debug_command#85 at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\commands.jl:521
debug_command at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\JuliaInterpreter\src\commands.jl:453
jfptr_debug_command_993 at C:\Users\Administrator\.julia\compiled\v1.9\VSCodeDebugger\xYOi8_VpF9I.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:774
#invokelatest#2 at .\essentials.jl:816 [inlined]
invokelatest at .\essentials.jl:813 [inlined]
our_debug_command at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\DebugAdapter\src\debugger_core.jl:67
startdebug at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\DebugAdapter\src\packagedef.jl:106
startdebugger at c:\Users\Administrator\.vscode\extensions\julialang.language-julia-1.79.2\scripts\packages\VSCodeDebugger\src\VSCodeDebugger.jl:43
unknown function (ip: 0000000061523413)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:226
eval_stmt_value at C:/workdir/src\interpreter.c:177 [inlined]
eval_body at C:/workdir/src\interpreter.c:624
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:762
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:912
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
ijl_toplevel_eval at C:/workdir/src\toplevel.c:921 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:971
eval at .\boot.jl:370 [inlined]
include_string at .\loading.jl:1903
_include at .\loading.jl:1963
include at .\Base.jl:457
jfptr_include_47593.clone_1 at C:\Users\Administrator\AppData\Local\Programs\Julia-1.9.2\lib\julia\sys.dll (unknown line)
exec_options at .\client.jl:307
_start at .\client.jl:522
jfptr__start_47602.clone_1 at C:\Users\Administrator\AppData\Local\Programs\Julia-1.9.2\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
true_main at C:/workdir/src\jlapi.c:573
jl_repl_entrypoint at C:/workdir/src\jlapi.c:717
mainCRTStartup at C:/workdir/cli\loader_exe.c:59
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
Allocations: 7319885798 (Pool: 7319726151; Big: 159647); GC: 3108

What I wrote is an iterative algorithm. Each time, constraints are added to Gurobi. The first two iterations were successfully solved, but on the third iteration, it suddenly crashed. The lines of code that caused the crash (line 2652, line 2673) are as follows:

4 posts - 3 participants