coin-or / Clp

COIN-OR Linear Programming Solver
Other
408 stars 85 forks source link

ClpModel::emptyProblem bug? #138

Closed yashpuranik closed 4 years ago

yashpuranik commented 4 years ago

In ClpModel.cpp, in the function int ClpModel::emptyProblem(int infeasNumber, double infeasSum, bool printMessage), returnCode can be set to 2 on line 3721 (https://github.com/coin-or/Clp/blob/00a8bc1b5114ecd8cbd6695a21b67b7d3cc61f2c/src/ClpModel.cpp#L3721), without modifying badColumn which is initialized to -1. This in turn leads to an invalid access on line 3753 (https://github.com/coin-or/Clp/blob/00a8bc1b5114ecd8cbd6695a21b67b7d3cc61f2c/src/ClpModel.cpp#L3753).

I believe this may be triggered when an LP with no rows has a nonzero cost for a variable with no upper or lower bounds. An appropriate fix probably requires fixing badValue and badColumn suitably in the section between lines 3717-3721.

johnjforrest commented 4 years ago

Should be fixed now in master