[Coin-lpsolver] Fw: [Coin-SMI] Smi unitTest crashes ClpNonLinearCost::ClpNonLinearCost(ClpSimplex*)

Alan King kingaj at us.ibm.com
Sun Mar 13 22:38:34 EST 2005


Hi John,

Someone on coin-smi said they had run it with #define INF COIN_DBL_MAX  in 
both places and still triggered a bug.  Let me try to post the obvious 
fixes first and lets see what happens.

I'll try to be sure that my libraries are freshly built. ;-)

Alan



John J Forrest/Watson/IBM at IBMUS 
Sent by: coin-lpsolver-bounces at list.coin-or.org
03/13/2005 05:14 PM

To
coin-smi at list.coin-or.org
cc
coin-lpsolver at list.coin-or.org
Subject
Re: [Coin-lpsolver] Fw: [Coin-SMI] Smi unitTest crashes 
ClpNonLinearCost::ClpNonLinearCost(ClpSimplex*)







With INF at 1.0e31 the assert fails.  With INF at 1.0e25 
ClpNonlinearCost.cpp writes beyond the end of array.  I will look into 
that but if I change INF to COIN_DBL_MAX my unitTest succeeds. 

John Forrest 


Alan King/Watson/IBM at IBMUS 
Sent by: coin-lpsolver-bounces at list.coin-or.org 
03/11/2005 04:41 PM 


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

Subject
[Coin-lpsolver] Fw: [Coin-SMI] Smi unitTest crashes 
ClpNonLinearCost::ClpNonLinearCost(ClpSimplex*)









Hi CLP folks, 

See below.  I'll check the SMI/unitTest  but it looks as if it is 
triggering some strange behavior in Clp. 

Alan 
----- Forwarded by Alan King/Watson/IBM on 03/11/2005 04:39 PM ----- 
Alan King/Watson/IBM at IBMUS 
Sent by: coin-smi-bounces at list.coin-or.org 
03/11/2005 04:36 PM 


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

Subject
Re: [Coin-SMI] Smi unitTest crashes











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
_______________________________________________
Coin-SMI mailing list
Coin-SMI at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-smi_______________________________________________

Coin-lpsolver mailing list
Coin-lpsolver at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-lpsolver
_______________________________________________
Coin-lpsolver mailing list
Coin-lpsolver at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-lpsolver

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


More information about the Coin-SMI mailing list