jump-dev/GLPK.jl

"variable must be non-basic" crash with small unbounded problem

pkienscherf opened this issue · 5 comments

Hi, I encountered the following bug when trying to solve an unbounded problem. The original problem is quite long, but the bug can be reproduced with

m = Model(GLPK.Optimizer)
@variable(m, x[1:2] >= 0)
@constraint(m, x[2] >= 3)
@objective(m, Max, sum(x))
optimize!(m)

The following error occurs

lp_eval_tab_col: k = 3; variable must be non-basicError detected in file draft/glpapi12.c at line 936

signal (6): Abort trap: 6
in expression starting at REPL[17]:1
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 192750625 (Pool: 192707523; Big: 43102); GC: 180
Abort trap: 6

After which julia crashes.

I'm on MacOS Big Sur (11.0.1), with

[60bf3e95] GLPK v0.14.2
[4076af6c] JuMP v0.21.5

I'm not quite sure whether that is a GLPK.jl issue or a GLPK issue. If it's the latter, please let me know so I can report there!

The crash is internal to GLPK and should be reported upstream.

odow commented

This might actually be an issue here. I'll take a look.

odow commented

Can you try on master? I think I already fixed this in #155.

Here's what I get using master

julia> using GLPK

julia> using JuMP

julia> m = Model(GLPK.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: GLPK

julia> @variable(m, x[1:2] >= 0)
2-element Array{VariableRef,1}:
 x[1]
 x[2]

julia> @constraint(m, x[2] >= 3)
x[2]  3.0

julia> @objective(m, Max, sum(x))
x[1] + x[2]

julia> optimize!(m)

julia> primal_status(m)
INFEASIBILITY_CERTIFICATE::ResultStatusCode = 4

julia> value.(x)
2-element Array{Float64,1}:
 1.0
 0.0

(GLPK) pkg> st
Project GLPK v0.14.3
Status `~/.julia/dev/GLPK/Project.toml`
  [b99e7846] BinaryProvider v0.5.10
  [fa961155] CEnum v0.3.0
  [e8aa6df9] GLPK_jll v4.64.0+0
  [4076af6c] JuMP v0.21.5
  [b8f27783] MathOptInterface v0.9.15
  [8f399da3] Libdl

Looks good on master both for the toy problem and my original one.

odow commented

Great. I'll tag a new release.