<br><font size=2 face="sans-serif">Hi Francois,</font>
<br>
<br><font size=2 face="sans-serif">Please do me a favor and register with
the Coin-SMI mailing list (new as of today). &nbsp;Separate your bug report
into the two parts Smi unitTest.cpp and CoinMpsIO. &nbsp;Thanks!</font>
<br>
<br><font size=2 face="sans-serif">Alan</font>
<br><font size=2 face="sans-serif"><br>
Alan King<br>
Mathematical Sciences, IBM Research<br>
http://www.research.ibm.com/<br>
http://www.research.ibm.com/people/k/kingaj/<br>
<br>
Campus Relationship Manager: University of Washington<br>
http://www.washington.edu<br>
http://www.ibm.com/university</font>
<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-discuss-bounces@list.coin-or.org</font>
<p><font size=1 face="sans-serif">03/10/2005 10:37 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
Discussions about open source software for Operations Research &nbsp; &nbsp;
&nbsp; &nbsp;&lt;coin-discuss@list.coin-or.org&gt;</font></div></table>
<br>
<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-OR &lt;coin-discuss@list.coin-or.org&gt;</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-discuss] Smi unitTest.cpp crashes,
bug in CoinMpsIO</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt><br>
Hi:<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, inifity 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 delete in releaseRedundantInformation().<br>
<br>
Also, the destructor in SmiScnModel.cpp does not free memory correctly:
several<br>
delete must be replace by delete[] to get:<br>
<br>
SmiScnModel::~SmiScnModel()<br>
{<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;delete
osiStoch_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(core_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
delete core_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(drlo_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;delete[] drlo_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(drup_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;delete[] drup_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(dclo_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
delete[] dclo_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(dcup_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;delete[] dcup_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(dobj_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;delete[] dobj_;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(matrix_)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&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>
<br>
==28062== Invalid write of size 4<br>
==28062== &nbsp; &nbsp;at 0xD558C6: ClpNonLinearCost::ClpNonLinearCost(ClpSimplex*)
(ClpNo<br>
nLinearCost.cpp:108)<br>
==28062== &nbsp; &nbsp;by 0xDBBAA3: ClpSimplex::startup(int, int) (ClpSimplex.cpp:5622)<br>
==28062== &nbsp; &nbsp;by 0xDD6081: ClpSimplexPrimal::primal(int, int)
(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()
(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 /home/fmargot/COIN/Smi/Test/Linux-g/unitTest)<br>
==28062== &nbsp; &nbsp;Address 0x49085FC is 0 bytes after a block of size
300504 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*)
(ClpNo<br>
nLinearCost.cpp:96)<br>
==28062== &nbsp; &nbsp;by 0xDBBAA3: ClpSimplex::startup(int, int) (ClpSimplex.cpp:5622)<br>
==28062== &nbsp; &nbsp;by 0xDD6081: ClpSimplexPrimal::primal(int, int)
(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()
(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== <br>
==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-discuss mailing list<br>
Coin-discuss@list.coin-or.org<br>
http://list.coin-or.org/mailman/listinfo/coin-discuss<br>
</tt></font>
<br>