[Osi-tickets] [COIN-OR Open Solver Interface] #51: OsiVolSolverInterface::addCol SIGSEGV

COIN-OR Open Solver Interface coin-trac at coin-or.org
Thu Mar 6 06:46:36 EST 2008


#51: OsiVolSolverInterface::addCol SIGSEGV
---------------------+------------------------------------------------------
 Reporter:  nowozin  |       Owner:  mjs
     Type:  defect   |      Status:  new
 Priority:  major    |   Milestone:     
Component:  OsiVol   |     Version:     
 Keywords:           |  
---------------------+------------------------------------------------------
 I use COIN-OR Osi 0.98 (checked out from SVN at 5th March 2008) to solve a
 large linear program.    The code works as expected with OsiClp and OsiMsk
 but crashes with OsiVol and OsiCpx.  I only report the OsiVol case below
 but I suspect the bug is the same in OsiCpx.  The code programatically
 creates the problem in the following way (leaving out some details, but
 showing the order of calls):

 {{{
    OsiSolverInterface* si = new OsiVolSolverInterface;
    // use column major in order to cheaply append columns
    CoinPackedMatrix* matrix = new CoinPackedMatrix(true, 0, 0);
    double* varLB = new double[N];
    double* varUB = new double[N];
    double* objective = new double[N];
    // ... set variable upper/lower bounds and obj coefficients

    CoinPackedVector csum;
    // ... set some coefficients
    matrix->appendRow(csum);

    // Generate rows programmatically.  Do this in an extra matrix once
 instead of appending rows
    // to the column-major main matrix
    CoinPackedMatrix m_matrix(false, 0, 0);
    m_matrix.setDimensions(0, N);
    m_matrix.reserve(N * K, 2 * N * K, false);
    for (unsigned int n = 0; n < N*K; ++n) {
         CoinPackedVector nconstraint;
         // ... set some coefficients in nconstraint
         m_matrix.appendRow(margin_constraint);
    }
    matrix->bottomAppendPackedMatrix(m_matrix);

    double* rowLB = new double[1 + N*K];
    double* rowUB = new double[1 + N*K];
    // ... set rowLB/rowUB elements

    // Set constraint matrix
    si->assignProblem(matrix, varLB, varUB, objective, rowLB, rowUB);
    si->setObjSense(1); // minimize

    CoinPackedVector col;
    // ... setting elements in col
    // CRASH upon calling this line with si a OsiVolSolverInterface.
    si->addCol(col, 0.0, si->getInfinity(), 0.0);
 }}}

 My system is a x86 64bit system.
 Linux mohave 2.6.22-14-generic #1 SMP Tue Feb 12 02:46:46 UTC 2008 x86_64
 GNU/Linux

 The crash dump looks like this:
 {{{
 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 47594371764096 (LWP 8829)]
 0x00002b4967434ea0 in CoinDisjointCopyN<bool> () from /opt/coin-
 osi-0.98/lib/libOsiVol.so.0
 (gdb) bt
 #0  0x00002b4967434ea0 in CoinDisjointCopyN<bool> ()
    from /opt/coin-osi-0.98/lib/libOsiVol.so.0
 #1  0x00002b496742dd70 in OsiVolSolverInterface::colRimResize_ ()
    from /opt/coin-osi-0.98/lib/libOsiVol.so.0
 #2  0x00002b496742dfec in OsiVolSolverInterface::addCol ()
    from /opt/coin-osi-0.98/lib/libOsiVol.so.0
 #3  0x000000000041657d in
 Boosting::LPBoostMulticlassClassifier::AddMulticlassClassifier ()
 }}}

 If you need further information, please let me know.  I would provide an
 isolated test case but it is considerable work as the solver is just a
 part of a larger program.  If required, I can isolate a piece of code that
 reproduces the bug.

-- 
Ticket URL: <https://projects.coin-or.org/Osi/ticket/51>
COIN-OR Open Solver Interface <http://projects.coin-or.org/Osi>
An API for a variety of LP and MIP solvers (and more).



More information about the Osi-tickets mailing list