# Bug in JuMP

**URL:** <https://discourse.julialang.org/t/bug-in-jump/62129>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [May 31, 2021, 11:55am UTC](https://discourse.julialang.org/t/bug-in-jump/62129 "2021-05-31T11:55:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnZ](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Post date:** [May 31, 2021, 11:55am UTC](https://discourse.julialang.org/t/bug-in-jump/62129/1 "2021-05-31T11:55:56Z")

</div>

I am running into an unusual error if I specify a method (such as dual simplex, barrier) to use. The solver finds a solution but then I get an error message and Julia exits.

The code below reproduces the error. Is this error coming from JuMP or Cbc?

```julia
using JuMP, Cbc

a = rand(10:55,20)
b = rand(10:25,20)
e = rand(10:20,20)

function err_model(a,b,e)
    model = Model(Cbc.Optimizer)
    set_optimizer_attribute(model,"solve" , "dualSimplex") # This line is the source of the error
    @variable(model, x[1:20],Bin)
    @objective(model,Min,sum(x[i]*e[i] for i=1:20))
    @constraint(model,sum(x[i]*a[i] -b[i] for i=1:20) >=0)
    optimize!(model)
    return value.(x)
end
    err_model(a,b,e)

```

```julia
Result - Optimal solution found

Objective value: 95.00000000
Enumerated nodes: 0
Total iterations: 3
Time (CPU seconds): 1.47
Time (Wallclock seconds): 1.46

Presolve 0 (-1) rows, 0 (-20) columns and 0 (-20) elements
Optimal - objective value 95
After Postsolve, objective 95, infeasibilities - dual 0 (0), primal 0 (0)
Optimal objective 95 - 0 iterations time 0.032, Presolve 0.02

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 0x0 -- unknown function (ip: 0000000000000000)
in expression starting at untitled-d84a489a2d41c442762dacd4c1b93718:16
unknown function (ip: 0000000000000000)

```

---

<div class="post-metadata">

**Author:** ![blegat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blegat/32/217090_2.png) [@blegat](https://discourse.julialang.org/u/blegat)\
**Post date:** [May 31, 2021, 12:52pm UTC](https://discourse.julialang.org/t/bug-in-jump/62129/2 "2021-05-31T12:52:19Z")

</div>

It seems the segmentation fault is coming from Cbc, not from its Julia interface or its MathOptInterface implementation. I would raise the issue here: [GitHub - coin-or/Cbc: COIN-OR Branch-and-Cut solver](https://github.com/coin-or/Cbc)

---

<div class="post-metadata">

**Author:** ![JohnZ](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Post date:** [May 31, 2021, 6:02pm UTC](https://discourse.julialang.org/t/bug-in-jump/62129/3 "2021-05-31T18:02:13Z")

</div>

Thank you @blegat

I have raised an issue on coin-or github: [Segmentation fault in Cbc · Issue #411 · coin-or/Cbc (github.com)](https://github.com/coin-or/Cbc/issues/411)
