<br><font size=2 face="sans-serif">Hi Francois,</font>
<br>
<br><font size=2 face="sans-serif">I will make the fixes. &nbsp;Thanks!</font>
<br>
<br><font size=2 face="sans-serif">The remaining problem appears to emanate
from CLP. &nbsp;I'll post it to the lpsolver discussion list and check
it out.</font>
<br>
<br><font size=2 face="sans-serif">Alan</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Francois Margot &lt;fmargot@andrew.cmu.edu&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: coin-smi-bounces@list.coin-or.org</font>
<p><font size=1 face="sans-serif">03/11/2005 09:22 AM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">coin-smi@list.coin-or.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[Coin-SMI] Smi unitTest crashes</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Hi:<br>
<br>
Note that the information on the coin-smi mailing list does not appear
on the <br>
main page at:<br>
http://www.coin-or.org/mail.html<br>
<br>
It only appears on:<br>
http://list.coin-or.org/mailman/listinfo/<br>
<br>
The following is a repost of the message I sent to coin-discuss yesterday.<br>
<br>
All COIN and Smi code are compiled with -g, lapack, and blas installed.<br>
<br>
The unitTest of Smi fails on an assert related to upper bounds on variables.<br>
This comes from the fact that ClpModel::gutsOfLoadModel readjusts the upper<br>
bounds to COIN_DBL_MAX when the upper bound is &gt; 1e27. In the unitTest<br>
code, infinity is set to 1e31 and the assert fails since the expected<br>
value of the upper bound is 1e31 when it is COIN_DBL_MAX.<br>
<br>
The easiest way to fix this is to set INF = 1e25 in Smi/unitTest.cpp<br>
(Note that INF is defined at two places in Smi/UnitTest.cpp).<br>
<br>
After this change, the program still crashes on line 820 (initialSolve()).<br>
I could not figure out why, but valgrind detects an error in CoinMpsIO.<br>
The allocation of hash_ (in startHash()) is done with a new and the memory<br>
is freed with a free() instead of a delete in releaseRedundantInformation().<br>
<br>
Also, the destructor in SmiScnModel.cpp does not free memory correctly:<br>
several delete must be replace by delete[] to get:<br>
<br>
SmiScnModel::~SmiScnModel()<br>
{<br>
 &nbsp; &nbsp; &nbsp; &nbsp; delete osiStoch_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if (core_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete core_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if (drlo_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete[] drlo_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if (drup_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete[] drup_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if (dclo_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;delete[] dclo_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if (dcup_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete[] dcup_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if (dobj_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete[] dobj_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if (matrix_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete matrix_;<br>
<br>
Even after correcting all the above, it still crashes. The first<br>
error detected by valgrind is:<br>
<br>
==28062== Invalid write of size 4<br>
==28062== &nbsp; &nbsp;at 0xD558C6: ClpNonLinearCost::ClpNonLinearCost(ClpSimplex*)<br>
(ClpNo<br>
nLinearCost.cpp:108)<br>
==28062== &nbsp; &nbsp;by 0xDBBAA3: ClpSimplex::startup(int, int)<br>
(ClpSimplex.cpp:5622)<br>
==28062== &nbsp; &nbsp;by 0xDD6081: ClpSimplexPrimal::primal(int, int)<br>
(ClpSimplexPrimal.c<br>
pp:191)<br>
==28062== &nbsp; &nbsp;by 0xDB3DB5: ClpSimplex::primal(int, int) (ClpSimplex.cpp:3632)<br>
==28062== &nbsp; &nbsp;by 0x647A85: OsiClpSolverInterface::initialSolve()<br>
(OsiClpSolverInt<br>
erface.cpp:169)<br>
==28062== &nbsp; &nbsp;by 0x8054059: SmiScnModelScenarioUnitTest() (unitTest.cpp:820)<br>
==28062== &nbsp; &nbsp;by 0x8055797: main (unitTest.cpp:1467)<br>
==28062== &nbsp; &nbsp;by 0x674BFB: __libc_start_main (in /lib/libc-2.3.2.so)<br>
==28062== &nbsp; &nbsp;by 0x804D730: (within<br>
/home/fmargot/COIN/Smi/Test/Linux-g/unitTest)<br>
==28062== &nbsp; &nbsp;Address 0x49085FC is 0 bytes after a block of size
300504<br>
alloc'd<br>
==28062== &nbsp; &nbsp;at 0x507886: __builtin_vec_new (vg_replace_malloc.c:203)<br>
==28062== &nbsp; &nbsp;by 0x5078DD: operator new[](unsigned) (vg_replace_malloc.c:216)<br>
==28062== &nbsp; &nbsp;by 0xD5580D: ClpNonLinearCost::ClpNonLinearCost(ClpSimplex*)<br>
(ClpNo<br>
nLinearCost.cpp:96)<br>
==28062== &nbsp; &nbsp;by 0xDBBAA3: ClpSimplex::startup(int, int)<br>
(ClpSimplex.cpp:5622)<br>
==28062== &nbsp; &nbsp;by 0xDD6081: ClpSimplexPrimal::primal(int, int)<br>
(ClpSimplexPrimal.c<br>
pp:191)<br>
==28062== &nbsp; &nbsp;by 0xDB3DB5: ClpSimplex::primal(int, int) (ClpSimplex.cpp:3632)<br>
==28062== &nbsp; &nbsp;by 0x647A85: OsiClpSolverInterface::initialSolve()<br>
(OsiClpSolverInt<br>
erface.cpp:169)<br>
==28062== &nbsp; &nbsp;by 0x8054059: SmiScnModelScenarioUnitTest() (unitTest.cpp:820)<br>
==28062== &nbsp; &nbsp;by 0x8055797: main (unitTest.cpp:1467)<br>
==28062== &nbsp; &nbsp;by 0x674BFB: __libc_start_main (in /lib/libc-2.3.2.so)<br>
==28062== ==28062== Invalid write of size 4<br>
<br>
I hope someone knowing a little bit more about Smi than I do can fix this.<br>
<br>
Francois<br>
_______________________________________________<br>
Coin-SMI mailing list<br>
Coin-SMI@list.coin-or.org<br>
http://list.coin-or.org/mailman/listinfo/coin-smi<br>
</tt></font>
<br>