[Cbc] Problem in CoinFactorization::pivotOneOtherRow when adding a constraint that contains a variable more than once

Ted Ralphs ted at lehigh.edu
Sat Jan 28 19:00:41 EST 2012


Hmm, this bug will not be so easy to track down. It seems to be a
problem with the specific way in which you are handing the problem to
Cbc and it is handing the problem to Clp. If you give the problem to
either the Clp or Cbc binary with

cbc crash3.lp
clp crash3.lp

it works fine and you get the message

"Matrix will be packed to eliminate 1 duplicate elements"

This message comes from the preprocessor, which is supposed to detect
things like this. Somehow, you are bypassing the preprocessor and Clp
is probably somehow assuming the problem was preprocessed. Ideally, it
wouldn't be possible to do this, but I suggest sticking with the
examples containing John's magic incantations to avoid these problems
:).

The difference you are seeing between 2.5 and 2.7 seems to just be
because you built the code with -DNDEBUG in one case and not in the
other. If I build 2.7 with --enable-debug and then run your example, I
get exactly the same result as 2.7.

Cheers,

Ted

On Tue, Nov 15, 2011 at 9:12 AM, Falk Hueffner <falk at debian.org> wrote:
> Hi,
>
> as the subject says:
>
> $ cat test.cc
> #include <coin/OsiClpSolverInterface.hpp>
> #include <coin/CbcModel.hpp>
>
> int main() {
>  CbcModel model = CbcModel(OsiClpSolverInterface());
>  model.solver()->readLp("/dev/stdin");
>  model.branchAndBound();
>  return 0;
> }
>
>
> $ cat crash3.lp
> \Problem name:
>
> Minimize
> obj: - x0
> Subject To
> cons0:  x0 + x0 <= 1
> cons1:  x1 <= 1
> Bounds
> End
>
>
> $ g++ -g -O3 -W -Wall -I /home/hueffner/opt/cbc-2.7/include test.cc -L/home/hueffner/opt/cbc-2.7/lib -lCbc -lCbcSolver -lCgl -lClp -lCoinUtils -lOsiClp -lOsi -lz -lrt && ./a.out < crash3.lp
> Cbc3007W No integer variables - nothing to do
> Clp0006I 0  Obj 0 Dual inf 0.9999999 (1)
> Clp0006I 0  Obj 0 Dual inf 0.9999999 (1)
> zsh: segmentation fault  ./a.out < crash3.lp
>
> This is with cbc 2.7 from svn. The segfault sometimes disappears
> depending on surrounding code. valgrind reports an invalid read in
> CoinFactorization::pivotOneOtherRow. With 2.5.0, I get:
>
> Cbc3007W No integer variables - nothing to do
> Clp0006I 0  Obj 0 Dual inf 1 (1)
> a.out: CoinFactorization1.cpp:2108: bool CoinFactorization::pivotOneOtherRow(int, int): Assertion `where < end' failed.
> zsh: abort      ./a.out < crash3.lp
>
> Maybe this is not a valid .lp file, but cbc probably shouldn't crash.
>
>  Falk
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc



-- 
Dr. Ted Ralphs
Associate Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted



More information about the Cbc mailing list