[Coin-discuss] CoinRowCut and Sbb problems in MSVS 6.0

Yan Xu yax2 at lehigh.edu
Thu Jun 19 21:40:08 EDT 2003


When replace the number of allocated entries by numberToAdd+1, Sbb works 
fine.

If try num=1, Q1 has no problem. But I still don't see why num=0 fails 
for OsiRowCut while is fine for other data types.

I checked my SbbModel.cpp status, it is up-to-date :-)

===================================================================
File: SbbModel.cpp      Status: Up-to-date

   Working revision:    1.31
   Repository revision: 1.31    /usr/cvs/coin/COIN/Sbb/SbbModel.cpp,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)


Yan



Laszlo Ladanyi wrote:

>Note that this is just guesswork since I do not use Windows.
>
>I sort of hesitate to say this, but this suspiciously looks like a compiler
>bug... From your Q2 it seems that the generated code has no problems deleting
>the array when more than 0 was allocated to start with and crashes when 0 cuts
>are allocated. An easy way to test this would be to replace the number of
>allocated entries by num+1. If that helps then it's almost certainly a
>compiler bug. Did you try your Q1 with num=1 ?
>
>BTW, when did you download SBB? In the current version there is no 
>'delete [] addCuts;' anywhere near line 1880 :-).
>
>--Laci
>
>On Thu, 19 Jun 2003, Yan Xu wrote:
>
>  
>
>>Hi, I encounted some problems when using Sbb in Windows, compiler is MSVS6.0
>>
>>Question 1: Why following code crashes when delete [] A, but declaring A 
>>as many other types (I tried int, char, ..., and some user-defined 
>>class) is fine? Is there a problem in OsiRowCut ?
>>
>>#include <iostream>
>>#include "OsiRowCut.hpp"
>>using namespace std;
>>
>>int main()
>>{
>>    int num = 0;
>>
>>    OsiRowCut* A = new OsiRowCut [num];
>>//  int* A = new int [num];                          // OTHER TYPE IS FINE
>>
>>    cout << "num = " << num << endl;
>>    delete [] A;                                            // CRASH HERE
>>    return 0;
>>}
>>
>>
>>Question 2:  When running Sbb with input data file: fiber, dcmutli, it 
>>crashes. The place cause crash is line 1880 of SbbModel.cpp
>>
>>                    delete [] addCuts;
>>
>>After  print numberToAdd, something like:
>>.......
>>numberToAdd = 15
>>numberToAdd = 25
>>numberToAdd = 6
>>numberToAdd = 3
>>numberToAdd = 4
>>numberToAdd = 5
>>numberToAdd = 0  // CRASH AFTER THIS LINE
>>
>>I found when numberToAdd is 0, 'delete' crashes, which brings the first 
>>question.
>>
>>Anyone have some idea, thanks. By the way, I don't have these problems 
>>in my Linux machine.
>>
>>Yan
>>
>>
>>
>>
>>
>>
>>
>>_______________________________________________
>>Coin-discuss mailing list
>>Coin-discuss at www-124.ibm.com
>>http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss
>>
>>    
>>
>
>_______________________________________________
>Coin-discuss mailing list
>Coin-discuss at www-124.ibm.com
>http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss
>  
>


-- 
Yan Xu
PhD Student                                     | Tel:   610-758-4042
Department of Instrial and Systems Engineering  | Fax:   610-758-4886
Lehigh University                               | Email: yax2 at lehigh.edu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20030619/0c751043/attachment.html>


More information about the Coin-discuss mailing list