[Coin-SMI] Smi unitTest crashes

Alan King kingaj at us.ibm.com
Fri Mar 11 16:36:16 EST 2005


Hi Francois,

I will make the fixes.  Thanks!

The remaining problem appears to emanate from CLP.  I'll post it to the 
lpsolver discussion list and check it out.

Alan




Francois Margot <fmargot at andrew.cmu.edu> 
Sent by: coin-smi-bounces at list.coin-or.org
03/11/2005 09:22 AM

To
coin-smi at list.coin-or.org
cc

Subject
[Coin-SMI] Smi unitTest crashes






Hi:

Note that the information on the coin-smi mailing list does not appear on 
the 
main page at:
http://www.coin-or.org/mail.html

It only appears on:
http://list.coin-or.org/mailman/listinfo/

The following is a repost of the message I sent to coin-discuss yesterday.

All COIN and Smi code are compiled with -g, lapack, and blas installed.

The unitTest of Smi fails on an assert related to upper bounds on 
variables.
This comes from the fact that ClpModel::gutsOfLoadModel readjusts the 
upper
bounds to COIN_DBL_MAX when the upper bound is > 1e27. In the unitTest
code, infinity is set to 1e31 and the assert fails since the expected
value of the upper bound is 1e31 when it is COIN_DBL_MAX.

The easiest way to fix this is to set INF = 1e25 in Smi/unitTest.cpp
(Note that INF is defined at two places in Smi/UnitTest.cpp).

After this change, the program still crashes on line 820 (initialSolve()).
I could not figure out why, but valgrind detects an error in CoinMpsIO.
The allocation of hash_ (in startHash()) is done with a new and the memory
is freed with a free() instead of a delete in 
releaseRedundantInformation().

Also, the destructor in SmiScnModel.cpp does not free memory correctly:
several delete must be replace by delete[] to get:

SmiScnModel::~SmiScnModel()
{
         delete osiStoch_;

         if (core_)
                 delete core_;

         if (drlo_)
           delete[] drlo_;

         if (drup_)
           delete[] drup_;

         if (dclo_)
          delete[] dclo_;

         if (dcup_)
           delete[] dcup_;

         if (dobj_)
           delete[] dobj_;

         if (matrix_)
                 delete matrix_;

Even after correcting all the above, it still crashes. The first
error detected by valgrind is:

==28062== Invalid write of size 4
==28062==    at 0xD558C6: ClpNonLinearCost::ClpNonLinearCost(ClpSimplex*)
(ClpNo
nLinearCost.cpp:108)
==28062==    by 0xDBBAA3: ClpSimplex::startup(int, int)
(ClpSimplex.cpp:5622)
==28062==    by 0xDD6081: ClpSimplexPrimal::primal(int, int)
(ClpSimplexPrimal.c
pp:191)
==28062==    by 0xDB3DB5: ClpSimplex::primal(int, int) 
(ClpSimplex.cpp:3632)
==28062==    by 0x647A85: OsiClpSolverInterface::initialSolve()
(OsiClpSolverInt
erface.cpp:169)
==28062==    by 0x8054059: SmiScnModelScenarioUnitTest() 
(unitTest.cpp:820)
==28062==    by 0x8055797: main (unitTest.cpp:1467)
==28062==    by 0x674BFB: __libc_start_main (in /lib/libc-2.3.2.so)
==28062==    by 0x804D730: (within
/home/fmargot/COIN/Smi/Test/Linux-g/unitTest)
==28062==    Address 0x49085FC is 0 bytes after a block of size 300504
alloc'd
==28062==    at 0x507886: __builtin_vec_new (vg_replace_malloc.c:203)
==28062==    by 0x5078DD: operator new[](unsigned) 
(vg_replace_malloc.c:216)
==28062==    by 0xD5580D: ClpNonLinearCost::ClpNonLinearCost(ClpSimplex*)
(ClpNo
nLinearCost.cpp:96)
==28062==    by 0xDBBAA3: ClpSimplex::startup(int, int)
(ClpSimplex.cpp:5622)
==28062==    by 0xDD6081: ClpSimplexPrimal::primal(int, int)
(ClpSimplexPrimal.c
pp:191)
==28062==    by 0xDB3DB5: ClpSimplex::primal(int, int) 
(ClpSimplex.cpp:3632)
==28062==    by 0x647A85: OsiClpSolverInterface::initialSolve()
(OsiClpSolverInt
erface.cpp:169)
==28062==    by 0x8054059: SmiScnModelScenarioUnitTest() 
(unitTest.cpp:820)
==28062==    by 0x8055797: main (unitTest.cpp:1467)
==28062==    by 0x674BFB: __libc_start_main (in /lib/libc-2.3.2.so)
==28062== ==28062== Invalid write of size 4

I hope someone knowing a little bit more about Smi than I do can fix this.

Francois
_______________________________________________
Coin-SMI mailing list
Coin-SMI at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-smi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/smi/attachments/20050311/f6e2dc6a/attachment.html 


More information about the Coin-SMI mailing list