[Osi] Adding a row provokes a segfault

Stefan Vigerske stefan at math.hu-berlin.de
Thu Jul 22 09:03:45 EDT 2010


Hi,

you seem to use columns in your row that had not been added before.

Stefan

Christophe-Marie Duquesne wrote:
> Hi list,
> 
> The following program segfaults:
> 
> #include <coin/OsiSolverInterface.hpp>
> #include <coin/OsiClpSolverInterface.hpp>
> #include <coin/CoinPackedVector.hpp>
> 
> 
> int main(int argc, const char *argv[])
> {
>     OsiSolverInterface * solver = new OsiClpSolverInterface();
> 
>     CoinPackedVector vector;
>     vector.insert(1, 1);
> 
>     solver->addRow(vector, 0, 1);
> 
>     delete solver;
>     return 0;
> }
> 
> Here is a backtrace with gdb:
> 
> #0  0x00330e59 in CoinPackedMatrix::appendMinorVector (this=0x804e9f0,
> vecsize=1, vecind=0x804e878, vecelem=0x804e8a8) at
> CoinPackedMatrix.cpp:1314
> #1  0x0033102a in CoinPackedMatrix::appendMinorVector (this=0x804e9f0,
> vec=...) at CoinPackedMatrix.cpp:1345
> #2  0x0032da45 in CoinPackedMatrix::appendRow (this=0x804e9f0,
> vec=...) at CoinPackedMatrix.cpp:239
> #3  0x0019ad10 in OsiClpSolverInterface::addRow (this=0x804afa0,
> vec=..., rowlb=0, rowub=1) at OsiClpSolverInterface.cpp:3041
> 
> Attached is an archive with this program and a Makefile. Set the OSI
> flags according to your system.
> 
> Did I do something wrong?
> 
> Cheers,
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Osi mailing list
> Osi at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/osi


-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan




More information about the Osi mailing list