Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault since v1.1 #214

Closed
ValentinKaisermayer opened this issue Apr 19, 2023 · 7 comments · Fixed by #216
Closed

Segmentation fault since v1.1 #214

ValentinKaisermayer opened this issue Apr 19, 2023 · 7 comments · Fixed by #216

Comments

@ValentinKaisermayer
Copy link

import JuMP
import Cbc
model = JuMP.read_from_file("model.mof.json")
JuMP.set_optimizer(model, Cbc.Optimizer)
JuMP.optimize!(model)

[9961bab8] Cbc v1.1.0
[4076af6c] JuMP v1.10.0

model.mof.zip

@odow
Copy link
Member

odow commented Apr 19, 2023

I cannot reproduce:

julia> import JuMP

julia> import Cbc

julia> model = JuMP.read_from_file("model.mof.json")
A JuMP Model
Feasibility problem with:
Variables: 1440
`JuMP.AffExpr`-in-`MathOptInterface.EqualTo{Float64}`: 55 constraints
`JuMP.AffExpr`-in-`MathOptInterface.GreaterThan{Float64}`: 189 constraints
`JuMP.AffExpr`-in-`MathOptInterface.LessThan{Float64}`: 189 constraints
`JuMP.VariableRef`-in-`MathOptInterface.GreaterThan{Float64}`: 1440 constraints
`JuMP.VariableRef`-in-`MathOptInterface.LessThan{Float64}`: 1440 constraints
`JuMP.VariableRef`-in-`MathOptInterface.Integer`: 1291 constraints
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.

julia> JuMP.set_optimizer(model, Cbc.Optimizer)

julia> JuMP.optimize!(model)
Welcome to the CBC MILP Solver 
Version: 2.10.5 
Build Date: Dec  4 2021 

command line - Cbc_C_Interface -solve -quit (default strategy 1)
Continuous objective value is 0 - 0.03 seconds
Cgl0002I 13 variables fixed
Cgl0003I 0 fixed, 2 tightened bounds, 0 strengthened rows, 0 substitutions
Cgl0004I processed model has 246 rows, 732 columns (699 integer (77 of which binary)) and 24145 elements
Cbc0045I No integer variables out of 699 objects (699 integer) have costs
Cbc0045I branch on satisfied N create fake objective Y random cost Y
Cbc0012I Integer solution of 0 found by DiveCoefficient after 0 iterations and 0 nodes (0.08 seconds)
Cbc0001I Search completed - best objective 0, took 0 iterations and 0 nodes (0.08 seconds)
Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost
Cuts at root node changed objective from 0 to 0
Probing was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Gomory was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Knapsack was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Clique was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
MixedIntegerRounding2 was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
FlowCover was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
TwoMirCuts was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
ZeroHalf was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)

Result - Optimal solution found

Objective value:                0.00000000
Enumerated nodes:               0
Total iterations:               0
Time (CPU seconds):             0.09
Time (Wallclock seconds):       0.10

Total time (CPU seconds):       0.09   (Wallclock seconds):       0.10


(cbc) pkg> st
      Status `/private/tmp/cbc/Project.toml`
  [9961bab8] Cbc v1.1.0
  [4076af6c] JuMP v1.10.0

What is versioninfo()?

If you have a segfault, I'd just use HiGHS instead.

@DrChainsaw
Copy link

I guess it is a windows thing:

julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, haswell)
  Threads: 1 on 12 virtual cores
Environment:
  JULIA_DEPOT_PATH = E:/Programs/julia/.julia
  JULIA_PKG_DEVDIR = E:/Programs/julia/.julia/dev

julia> import JuMP

julia> import Cbc

julia> model = JuMP.read_from_file("model.mof.json")
A JuMP Model
Minimization problem with:
Variables: 55
Objective function type: JuMP.AffExpr
`JuMP.AffExpr`-in-`MathOptInterface.EqualTo{Float64}`: 22 constraints
`JuMP.AffExpr`-in-`MathOptInterface.GreaterThan{Float64}`: 110 constraints
`JuMP.AffExpr`-in-`MathOptInterface.LessThan{Float64}`: 110 constraints
`JuMP.VariableRef`-in-`MathOptInterface.GreaterThan{Float64}`: 22 constraints
`JuMP.VariableRef`-in-`MathOptInterface.LessThan{Float64}`: 22 constraints
`JuMP.VariableRef`-in-`MathOptInterface.ZeroOne`: 11 constraints
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.

julia> JuMP.set_optimizer(model, Cbc.Optimizer)

julia> JuMP.optimize!(model)
Welcome to the CBC MILP Solver
Version: 2.10.8
Build Date: Jan  1 1970

command line - Cbc_C_Interface -solve -quit (default strategy 1)
Continuous objective value is 6.75 - 0.00 seconds
Cgl0002I 5 variables fixed
Cgl0004I processed model has 0 rows, 0 columns (0 integer (0 of which binary)) and 0 elements
Cbc3007W No integer variables - nothing to do
Cuts at root node changed objective from 6.75 to -1.79769e+308
Probing was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Gomory was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Knapsack was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Clique was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
MixedIntegerRounding2 was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
FlowCover was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
TwoMirCuts was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
ZeroHalf was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)

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 0x7ffc3b74a6bc -- _ZN11ClpPresolve20gutsOfPresolvedModelEP10ClpSimplexdbibbPKcS3_ at E:\Programs\julia\.julia\artifacts\f5d5304c8eecdf9001ddfe7620a0fd169798437b\bin\libClp-1.dll (unknown line)
in expression starting at REPL[5]:1
_ZN11ClpPresolve20gutsOfPresolvedModelEP10ClpSimplexdbibbPKcS3_ at E:\Programs\julia\.julia\artifacts\f5d5304c8eecdf9001ddfe7620a0fd169798437b\bin\libClp-1.dll (unknown line)
_ZN21OsiClpSolverInterface12initialSolveEv at E:\Programs\julia\.julia\artifacts\f5d5304c8eecdf9001ddfe7620a0fd169798437b\bin\libOsiClp-1.dll (unknown line)
_ZN13CglPreProcess11postProcessER18OsiSolverInterfacei at E:\Programs\julia\.julia\artifacts\a1ad45479b5b6e40ef38503415c1750f5421d010\bin\libCgl-1.dll (unknown line)
_Z8CbcMain1iPPKcR8CbcModelPFiPS2_iER19CbcSolverUsefulData at E:\Programs\julia\.julia\artifacts\ede8b8ffb967bcc0a608305548128d1ff5605277\bin\libCbcSolver-3.dll (unknown line)
Cbc_solve at E:\Programs\julia\.julia\artifacts\ede8b8ffb967bcc0a608305548128d1ff5605277\bin\libCbcSolver-3.dll (unknown line)
Cbc_solve at E:\Programs\julia\.julia\packages\Cbc\dIPfi\src\gen\libcbc_api.jl:306 [inlined]
optimize! at E:\Programs\julia\.julia\packages\Cbc\dIPfi\src\MOI_wrapper\MOI_wrapper.jl:521
optimize! at E:\Programs\julia\.julia\packages\MathOptInterface\vwZYM\src\MathOptInterface.jl:85 [inlined]
optimize! at E:\Programs\julia\.julia\packages\MathOptInterface\vwZYM\src\Utilities\cachingoptimizer.jl:316
unknown function (ip: 000001f6c5653fa6)
unknown function (ip: 000001f6c562bdad)
unknown function (ip: 000001f6c562bcab)
optimize! at E:\Programs\julia\.julia\packages\MathOptInterface\vwZYM\src\Bridges\bridge_optimizer.jl:376 [inlined]
optimize! at E:\Programs\julia\.julia\packages\MathOptInterface\vwZYM\src\MathOptInterface.jl:85 [inlined]
optimize! at E:\Programs\julia\.julia\packages\MathOptInterface\vwZYM\src\Utilities\cachingoptimizer.jl:316
unknown function (ip: 000001f6c562bc66)
#optimize!#107 at E:\Programs\julia\.julia\packages\JuMP\pQApG\src\optimizer_interface.jl:440
optimize! at E:\Programs\julia\.julia\packages\JuMP\pQApG\src\optimizer_interface.jl:410
unknown function (ip: 000001f6c5611396)
jl_apply at C:/workdir/src\julia.h:1843 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:215
eval_stmt_value at C:/workdir/src\interpreter.c:166 [inlined]
eval_body at C:/workdir/src\interpreter.c:612
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:750
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:906
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:850
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:850
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:850
ijl_toplevel_eval at C:/workdir/src\toplevel.c:915 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:965
eval at .\boot.jl:368 [inlined]
eval_user_input at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:151
repl_backend_loop at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:247
start_repl_backend at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:232
#run_repl#47 at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:369
run_repl at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:355
jfptr_run_repl_66302.clone_1 at E:\Programs\julia\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
#967 at .\client.jl:419
jfptr_YY.967_28379.clone_1 at E:\Programs\julia\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1843 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:774
#invokelatest#2 at .\essentials.jl:729 [inlined]
invokelatest at .\essentials.jl:726 [inlined]
run_main_repl at .\client.jl:404
exec_options at .\client.jl:318
_start at .\client.jl:522
jfptr__start_54247.clone_1 at E:\Programs\julia\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1843 [inlined]
true_main at C:/workdir/src\jlapi.c:575
jl_repl_entrypoint at C:/workdir/src\jlapi.c:719
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: 45086360 (Pool: 45067730; Big: 18630); GC: 27

Works with Cbc 1.0.3.

@odow
Copy link
Member

odow commented Apr 20, 2023

Let's see if CI likes it: #215.

Very little changed, but it might be the naming issue: v1.0.3...v1.1.0

@odow
Copy link
Member

odow commented Apr 20, 2023

I've reproduced locally and in CI:

#215

Using MOI instead of JuMP seemed to do the trick, which means it likely depends on the order of constraints, etc.

There have been a bunch of similar issues:

x-ref coin-or/Clp#142
x-ref #187
x-ref coin-or/Cbc#367

The ETA to get this fixed is unknown. I'd use HiGHS instead.

@odow
Copy link
Member

odow commented Apr 20, 2023

Ah. Seems like it was the names that were causing the issue. It doesn't seem like the particular names were a problem, setting the names to anything (including "") was a problem.

Work-around: #215

@ValentinKaisermayer
Copy link
Author

Thanks @odow for figuring this out.

@odow
Copy link
Member

odow commented Apr 24, 2023

Since this is showing up in a few places, I'm going to turn off names by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants