<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div>Hi,<br><br>I am using Cbc-2.1.0 via OSI on a 64-bit version of Fedora Core 7. Cbc was compiled with debug info on.<br><br>I solve the problem with branchAndBound(), modify it by adding a feasible constraint and then call branchAndBound() again. The solver complains about infeasibility and, moreover, shows a memory handling issue when run through valgrind. A bug?<br><br>I attach an example reproducing the problem and an accompanying mps file.<br><br>Thanks,<br>Mikhail<br><div><br>***** bug.cpp *****<br>#include "OsiCbcSolverInterface.hpp"<br>#include <iostream><br>using namespace std;<br><br>int main()<br>{<br> OsiCbcSolverInterface test;<br> test.readMps("bug.mps");<br> test.branchAndBound();<br> int ind[] = {0};<br> double val[] = {1.0};<br> test.addRow(CoinShallowPackedVector(1,ind,val),-1e10,4504.05);<br> test.branchAndBound();<br> return 0;<br>}<br><br>***** bug.mps *****<br>NAME BLANK <br>ROWS<br> N OBJROW<br> L R0000000<br> L R0000001<br> L R0000002<br>COLUMNS<br> C0000000 OBJROW -1. <br> C0000001 OBJROW -1. <br> C0000002 OBJROW -1. <br> C0000003 OBJROW -2823.64158 R0000000 1. <br> C0000004 OBJROW -1598.68466 R0000001 1. <br> C0000005 OBJROW -2020.23639 R0000002 1. <br> C0000006 OBJROW -2823.64158 R0000000 1. <br> C0000007 OBJROW -1598.68466 R0000001 1. <br> C0000008 OBJROW -2020.23639 R0000002 1. <br> C0000009 OBJROW -2823.64158 R0000000 1. <br> C0000010 OBJROW -1598.68466 R0000001 1. <br> C0000011 OBJROW -2020.23639 R0000002 1. <br>RHS<br> RHS R0000000 1. R0000001 1. <br> RHS R0000002 1. <br>BOUNDS<br> MI BOUND C0000000 -1e+30<br> UP BOUND C0000000 1e+10<br> MI BOUND C0000001 -1e+30<br> UP BOUND C0000001 1e+10<br> MI BOUND C0000002 -1e+30<br> UP BOUND C0000002 1e+10<br> BV BOUND C0000003 1. <br> BV BOUND C0000004 1. <br> BV BOUND C0000005 1. <br> BV BOUND C0000006 1. <br> BV BOUND C0000007 1. <br> BV BOUND C0000008 1. <br> BV BOUND C0000009 1. <br> BV BOUND C0000010 1. <br> BV BOUND C0000011 1. <br>ENDATA<br><br>**** "valgrind ./bug" output ****<br>==20189== Memcheck, a memory error detector.<br>==20189== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.<br>==20189== Using LibVEX rev 1732, a library for dynamic binary translation.<br>==20189== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.<br>==20189== Using valgrind-3.2.3, a dynamic binary instrumentation framework.<br>==20189== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.<br>==20189== For more details, rerun with: -v<br>==20189== <br>==20189== Invalid read of size 4<br>==20189== at 0x435222: CbcNode::depth() const (CbcNode.hpp:626)<br>==20189== by 0x41530F: CbcModel::resolve(CbcNodeInfo*, int) (CbcModel.cpp:7078)<br>==20189== by 0x42C700: CbcModel::branchAndBound(int) (CbcModel.cpp:1214)<br>==20189== by 0x404EA1: OsiCbcSolverInterface::branchAndBound() (OsiCbcSolverInterface.cpp:782)<br>==20189== by 0x403171: main (bug.cpp:13)<br>==20189== Address 0x4DA8C78 is 88 bytes inside a block of size 104 free'd<br>==20189== at 0x4A052BD: operator delete(void*) (vg_replace_malloc.c:244)<br>==20189== by 0x43AEC8: CbcNode::~CbcNode() (CbcNode.cpp:4583)<br>==20189== by 0x42EBF7: CbcModel::branchAndBound(int) (CbcModel.cpp:1772)<br>==20189== by 0x404EA1: OsiCbcSolverInterface::branchAndBound() (OsiCbcSolverInterface.cpp:782)<br>==20189== by 0x4030C7: main (bug.cpp:9)<br>Coin0001I At line 1 NAME BLANK<br>Coin0001I At line 2 ROWS<br>Coin0001I At line 7 COLUMNS<br>Coin0001I At line 20 RHS<br>Coin0001I At line 23 BOUNDS<br>Coin0001I At line 39 ENDATA<br>Coin0002I Problem BLANK has 3 rows, 12 columns and 9 elements<br>Coin0008I BLANK read with 0 errors<br>Clp0006I 0 Obj -3e+10 Dual inf 19327.7 (9)<br>Clp0006I 6 Obj -3e+10<br>Clp0000I Optimal - objective value -3e+10<br>Clp0000I Optimal - objective value -3e+10<br>Cbc0004I Integer solution of -3e+10 found after 0 iterations and 0 nodes (1.23 seconds)<br>Cbc0001I Search completed - best objective -30000006442.56263, took 0 iterations and 0 nodes (1.26 seconds)<br>Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost<br>Clp0000I Optimal - objective value -3e+10<br>Clp0000I Optimal - objective value -3e+10<br>Clp0006I 0 Obj -3e+10 Primal inf 1e+10 (1)<br>Clp0006I 0 Obj 0 Primal inf 1e+10 (1)<br>Clp0006I 0 Obj 0 Primal inf 1e+10 (1)<br>Clp0001I Primal infeasible - objective value 0<br>Cbc0006I The LP relaxation is infeasible or too expensive<br>==20189== <br>==20189== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 1)<br>==20189== malloc/free: in use at exit: 0 bytes in 0 blocks.<br>==20189== malloc/free: 1,394 allocs, 1,394 frees, 4,773,619 bytes allocated.<br>==20189== For counts of detected errors, rerun with: -v<br>==20189== All heap blocks were freed -- no leaks are possible.<br><br></div></div></font>