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

Yan Xu yax2 at lehigh.edu
Thu Jun 19 17:27:46 EDT 2003


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










More information about the Coin-discuss mailing list